jqGrid - 无法在搜索对话框中填充选择 - 但在工具栏中可以

时间:2011-11-17 12:07:29

标签: jqgrid

这似乎没有意义,不幸的是,trirand上的一个例子似乎有同样的错误

使用此列模型

{name:'txtFixtureType', index:'txtFixtureType', width:110,
stype: 'select',
edittype:'select', editoptions: { 
value: ":All;1:Division 1;2:Division 2"}},

启用工具栏搜索会导致选择列,并填充值。但是,使用高级搜索对话框会出现选择,但不包含任何值。

是否需要设置一些附加属性?

1 个答案:

答案 0 :(得分:3)

尝试

{ name: 'txtFixtureType', index: 'txtFixtureType', width: 110,
    edittype: 'select',
    editoptions: { value: ":All;1:Division 1;2:Division 2" },
    stype: 'select',
    searchoptions: { sopt: ['eq', 'ne'], value: ":All;1:Division 1;2:Division 2" }
}

此外,根据您保存的数据,可能需要使用formatter: 'select'(请参阅the documentation)。

通常,您可以将工具栏搜索与高级搜索结合起来。请参阅the demo中的the answer

相关问题