Multiple search with multiplefields by default

后端 未结 2 973
孤城傲影
孤城傲影 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:14

    You cannot do this using the jqGrid API. Instead, you will have to use the afterShowSearch event to call a function after the search dialog is displayed. In that function you could programmatically add new rows, setting each one to the desired values.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题