Multiple search with multiplefields by default

后端 未结 2 979
孤城傲影
孤城傲影 2020-11-27 22:35

So, there is a jqGrid, with declaration, smth like:

$(\"#grid\").jqGrid({
...
bunch of stuff
...
).searchGrid({ multipleSearch: true });

wh

2条回答
  •  没有蜡笔的小新
    2020-11-27 23:29

    Look at the Toolbar Searching. It shows one field per searchable column. If you use additionally stringResult:true option, you will receive the most compatible results to the Advanced Searching. By the way it you include both features Toolbar Searching and Advanced Searching (multipleSearch: true) the advanced searching dialog will be initialized with the last searching results from the Toolbar Searching. So you will have two or three rows in the Advanced Searching at the beginning.

    UPDATED: The reason why after the usage of the Toolbar Searching the dialog with the Advanced Searching will be displayed not empty is that both use filters parameters of the postData. So if you initialize the postData you can receive a good starting point. See on the demo. You will see

    alt text

    UPDATE: In another answer you will find how to delete the last line of the searching dialog (with "Inv No") which are not the part of the searching rules from the postData.filters.

提交回复
热议问题