So, there is a jqGrid, with declaration, smth like:
$("#grid").jqGrid({
...
bunch of stuff
...
).searchGrid({ multipleSearch: true });
which is fine, when I click Search button, it brings me modal form with I guess first column and a dropdown of sopts: searchoptions: { sopt: [‘eq’, ‘ne’, ‘cn’]}.
Now, i want to be able to display a couple of such fields by default not just one. I know I can add those later, by clicking Add, but I want to display them by default.
Having toolbar search is not an option.
Thanks in advance,
Look at the Toolbar Searching. It shows one field per searchable column. If you use additionally
stringResult:trueoption, 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
filtersparameters of thepostData. So if you initialize thepostDatayou can receive a good starting point. See on the demo. You will seeUPDATE: 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.