jqgrid没有显示搜索自定义字段

时间:2015-10-28 21:14:16

标签: jqgrid

我正在将代码从jqgrid 4迁移到jqgrid 5.0.0,似乎无法解决此问题。
在jqgrid 5.0.0中我们还需要使用 searchoptions:{sopt

colModel:[
        {
            name:'col_id',
            key:false,
            index:'col_id',
            width:40,
            searchoptions: {sopt: ['bw','eq','ne','lt','le','gt','ge','ew','cn']},
            editable:false,
            edittype:'custom',
            editoptions:{custom_element:disabledelem, custom_value:elemvalue},
            formatter:customFormatter
        },

Not seeing search filters popup

我检查了源代码 jquery.jqGrid.5.0.0.js

我无法看到this.oper会以我使用它的方式获得一个值。 jqgrid的在线示例不是很清楚。

        $.each(that.p.ops, function() { aoprs.push(this.oper); });
        for ( i = 0; i < op.length; i++) {
            ina = $.inArray(op[i],aoprs);
            if(ina !== -1) {
                selected = rule.op === that.p.ops[ina].oper ? " selected='selected'" : "";
                str += "<option value='"+that.p.ops[ina].oper+"'"+selected+">"+that.p.ops[ina].text+"</option>";
            }
        }

1 个答案:

答案 0 :(得分:1)

这可能是您使用的Guriddo jqGrid JS 5.0.0中的错误。我建议您使用free jqGrid 4.10.0尝试相同的代码。您只需更改the wiki article中描述的网址即可。免费的jqGrid是jqGrid的分支,我在更改许可协议并将jqGrid重命名为Guriddo jqGrid JS后开发(参见here)。如果代码在fork中工作,您可以考虑迁移到free jqGrid。

相关问题