ASP.NETMVC2.0在jqGrid中搜索的实现
jQuery("#list").jqGrid({ url: '/Home/DynamicGridData/', datatype: 'json', mtype: 'POST', search: true, filters: { "groupOp":"AND", "rules": [ {"field":"Message","op":"eq","data":"True"} ] }, multipleSearch: false, colNames: [ 'column1', 'column2'], colModel: [ { name: 'column1', index: 'column1', sortable: true, search: true, sorttype: 'text', autoFit: true,stype:'text', searchoptions: { sopt: ['eq', 'ne', 'cn']} }, { name: 'column2', index: 'column2', sortable: true,search: false, sorttype: 'text', align: 'left', autoFit: true}], pager: jQuery('#pager'), rowNum: 10, rowList: [10, 60, 100], scroll: true, sortname: 'column2', sortorder: 'asc', gridview: true, autowidth: true, rownumbers: true, viewrecords: true, imgpath: '/scripts/themes/basic/images', caption: 'my data grid'});jQuery("#list").jqGrid('navGrid', '#pager', {add: false, edit: false, del: false}, {}, {}, {}, { multipleSearch: true, overlay: false });//jQuery("#list").jqGrid('filterToolbar', {stringResult:true, searchOnEnter:true});jQuery("#list").jqGrid('navButtonAdd', '#pager', { caption: "Finding", title: "Toggle Search Bar", buttonicon: 'ui-icon-pin-s', onClickButton: function() { $("#list")[0].toggleToolbar() } });jQuery("#list").jqGrid = { search : { caption: "Search...", Find: "Find", Reset: "Reset", odata : ['equal', 'not equal','contains'], groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ], matchText: " match", rulesText: " rules" }} });