Search code examples
jqgridfree-jqgrid

How can I keep tradicional filter format for new free-jqgrid?


I'm trying to upgrade from jqGrid v4.7 to the latest jqGrid 4.12.1 - free jqGrid fork.

The problem I face is that, using server side searching, filter parameters don´t get built using the former

{"groupOp":"AND","rules":[{"field":"Name","op":"cn","data":"bob"}]}

style, I just get an additional Name parameter with bob value (_search is true).

What am I missing here?

Thanks in advance


Solution

  • I suppose that you use filterToolbar without stringResult: true parameter and the problem have no relation with the upgrade of jqGrid 4.7 to free jqGrid 4.12.1. See the first part of the documentation of filterToolbar which describes:

    When the search is activated, an array of type name:value is posted to the server. Note that this array is added to the postData parameter. We post only fields that have an entered value. When we clear the the search form, the values are deleted from the postData array. When posting to the server, we try to pass, not the name, but the index set in colModel. When the index is not found we use the name. Additionally, we add a _search=true to the posted data.

    When the stringResult option is set to true the data posted to the server is a string and the structure of the posted data is the same as in Advanced Search.