I have a jqGrid populated with data, but I want to change how this is shown by editing the CSS.
So far so good, but I'm trying to have a dropdownlist which, when changed, will sort the jqGrid based on the value selected.
Is there anyway to actually call the sort function programmatically?
I have tried the following which, does nothing:
$("#grid").jqGrid('setGridParam',{sortname: 'yearEdition,', sortorder: 'desc'});
$("#grid").trigger("reloadGrid");
Is there indeed a way to call this event?
You should use sortGrid method of jqGrid:
Sorts the given colname and shows the appropriate sort icon. The same (without sorting icon) can be done using setGridParam({sortname:'myname'}).trigger('reloadGrid'). If the reload is set to true, the grid reloads with the current page and sortorder settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With