0

I am using jqgrid and the toolbar filter. After filtering I want to reload the searchoptions in the toolbar filter with:

loadComplete: function() {
mygrid.jqGrid('setColProp','device_nr',{searchoptions: {dataUrl:'filter_jq.php?val=newval'}});
 }

I tried also:

 var str = ":All;1:Dev1;2:Dev2";
 mygrid.jqGrid('setColProp','device_nr',{searchoptions:{value:str}})

But nothing changed.(but I can change the param "sopt"). Is it possible to change the searchoptions in filter toolbar with setColProp?

This is how it defined in ColModel:

colModel:[{name:'device_nr',index:'device_nr', width:100, stype: 'select',searchoptions:{dataUrl:'filter_jq.php?val=init',sopt:['eq']}}
]
Bijendra
  • 9,467
  • 8
  • 39
  • 66
Elena
  • 3
  • 1
  • 2
  • dataUrl - is called only once so if you change it make sure that you will trigger reload of the grid – firegnom Apr 21 '11 at 13:47

1 Answers1

3

I am afraid that you will have to manually modify the contain of the corresponding select element of the toolbar. If the name of the corresponding column in the colModel is 'device_nr' the id of the corresponding control will be 'gs_device_nr' and you should do the following:

$("#gs_device_nr").html('<option value="">All</option>'+
                        '<option value="1">Dev1</option>'+
                        '<option value="2">Dev1</option>');
Oleg
  • 220,925
  • 34
  • 403
  • 798