I use jqGrid with advanced search. For some reason I need to override the function that constructs postData.filters object.
Asked
Active
Viewed 186 times
0
-
**Why** you could need to overwrite the construct of `postData.filters`? You mean probably that you want to send *another* parameter as `filters` with your *custom* information, which your backend will use for filtering. Please write in all questions which **version** of jqGrid you use and from which **fork** of jqGrid ([free jqGrid](https://github.com/free-jqgrid/jqGrid), commercial [Guriddo jqGrid JS](http://guriddo.net/?page_id=103334) or an old jqGrid in version <=4.7). Which `datatype` you use? Do you use `loadonce: true`? How many rows has your grid (100, 1000, 10000, 1000000)? – Oleg Jan 19 '18 at 08:05
-
Right you are, @Oleg. I really need to send other values for some types of filter fields. The reason of it is the use of JQuery-UI autocomplete plugin. When the user selects one of the autocomplete values in dropdown list autocomplete plugin by default fills input field with the ui.item.value, but the user must see ui.item.label. That's why I override autocomplete select method and put the ui.item.label into filter . But when the postData.filters is sent to server, it must contain values instead of labels for filter fields of such type. – searcher Jan 21 '18 at 09:07
-
jqGrid 5.2.0. `loadonce: false`. `rowNum:60`, source DB table has few tens of thousands of rows. – searcher Jan 21 '18 at 09:07
-
The last version of "jqGrid" is version 4.7.0. Lather there are exist two main **forks**, base of jqGrid 4.7.0. ["free jqGrid"](https://github.com/free-jqgrid/jqGrid), which I develop, which latest version is 4.15.2 and **commercial** ["Guriddo jqGrid JS"](http://guriddo.net/?page_id=103334), which develop Tony Tomov and which current version is based 5.3.0. You use currently **commercial** product Guriddo jqGrid JS. I asked you additional about *total number of rows* in the grid. In case of small number of rows (<1000 or <10000) `loadonce: true` is mostly better. – Oleg Jan 21 '18 at 18:56
-
Additionally free jqGrid fork supports ` – Oleg Jan 21 '18 at 19:00
-
Thanks a lot for your explanation, @Oleg. I think I've got all answers I wished to get. – searcher Jan 22 '18 at 06:49
-
You are welcome! – Oleg Jan 22 '18 at 07:35