默认情况下具有多个字段的多重搜索 [英] Multiple search with multiplefields by default
问题描述
因此,有一个jqGrid,带有声明,类似:
So, there is a jqGrid, with declaration, smth like:
$("#grid").jqGrid({
...
bunch of stuff
...
).searchGrid({ multipleSearch: true });
这很好,当我单击搜索"按钮时,它为我带来了模态形式,其中包括第一列和一个sopts下拉列表:searchoptions:{sopt:['eq','ne','cn']}. 现在,我希望能够默认显示几个这样的字段,而不仅仅是一个.我知道以后可以单击添加"来添加它们,但是我想默认显示它们.
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.
无法使用工具栏搜索.
预先感谢
推荐答案
查看工具栏搜索和高级搜索(multipleSearch: true
),高级搜索对话框将是使用工具栏搜索的最后搜索结果进行初始化.因此,您将在高级搜索中有两到三行一开始.
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.
已更新:使用工具栏搜索使用高级搜索对话框将显示为非空,因为它们都使用postData
的filters
参数.因此,如果初始化postData
,则可以得到一个很好的起点.请参见该演示.您会看到
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
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
.
这篇关于默认情况下具有多个字段的多重搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!