Our website includes a jqGrid that initially retrieves its rows using the built-in ajax fetch feature, returning a json
object. We then apply filtering and searching on the client side by creating custom functions to generate postData filters. However, we have encountered an issue where the grid does not respond to these filters during the initial page load.
For example, even if we set a filter like "column A='foo' AND column B='bar'" and reflect this in the filterToolbar widgets upon page load, the grid still displays all rows. To make the grid apply the postData filters, we must trigger a reload, resulting in a brief delay before the filtered rows are displayed.
We have experimented with various methods, including manually setting jqGrid data in the beforeProcessing
event, but have not found a solution that prevents the need for grid reloading. While calling the buried populate()
method within jqGrid could potentially help, it has proven difficult to access the context required for calling it.
Most solutions we've found focus on server-side filtering, while those addressing client-side filtering seem to conclude that grid reloading is necessary. Is there a way to have jqGrid load data normally via json and then apply client-side postData filters before rendering the grid? We aim to have the filtered grid displayed from the start, rather than showing the unfiltered grid first.
If there are alternative approaches to prevent the initial display of the unfiltered grid when postData filters are present, we would appreciate any suggestions as workarounds.