将搜索选项限制为在JqGrid中等于和不等于

时间:2014-02-12 18:42:27

标签: jquery search jqgrid

我想将网格上的搜索选项限制为等于且不等于。我不想要其他选项,例如 (包含,不包含,以...开头,不包含,不在,不在......) 显示。到目前为止我已尝试过此代码,但它不起作用。有帮助吗?

}).navGrid("#pager", {
    search:true,
    edit:false,
    add:false,
    del:false,
    searchtext:"Search",
    refreshtext:"Refresh",
    searchoptions:{sopt: ['eq','ne']}       
});

谢谢期待您的回答!

1 个答案:

答案 0 :(得分:2)

为您的列明确指定排序选项,如下所示;

colModel: [
            { name: "patientDOB",index:'patientDOB',search:true, width: 90,searchoptions:{sopt:['eq','ne']} },
            { name: "referralProvider",index:'referralProvider',search:true, width: 90,searchoptions:{sopt:['eq','ne']} },
            { name: "referralReason",index:'referralReason',search:true, width: 120,searchoptions:{sopt:['eq','ne']} },
            { name: "contactName",index:'contactName',search:true, width: 100,searchoptions:{sopt:['eq','ne']}},
            { name: "contactPhone",index:'contactPhone',search:true, width: 100,searchoptions:{sopt:['eq','ne']}},
            { name: "contactEmail",index:'contactEmail',search:true, width: 100,searchoptions:{sopt:['eq','ne']} }
]