【问题标题】:jqGrid - cannot populate select in search dialog - but ok in toolbarjqGrid - 无法在搜索对话框中填充选择 - 但在工具栏中可以
【发布时间】:2011-12-31 07:07:46
【问题描述】:

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

使用此列模型

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

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

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

【问题讨论】:

    标签: jqgrid


    【解决方案1】:

    试试

    { 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 answer 看到the demo

    【讨论】:

    • 呃。当然,需要 searchoptions 而不是 editoptions,但让我感到震惊的是工具栏搜索 editoptions 也可以。
    • @Cruachan:您可以分享editoptions 并将其用于搜索,但在'select' 的情况下使用editoptions 而不使用':All' 部分更有意义。一般来说,如果 jqGrid 在搜索工具栏中自动添加 ':All' 或其他基于集合的内容会更好。例如,在高级搜索的情况下不需要“:全部”部分。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-20
    • 2012-06-04
    • 2012-06-13
    • 1970-01-01
    相关资源
    最近更新 更多