Hi Abu,
I can filter a single id. Is it possible to filter an array of id's.
eg. array("10016","12345","22222")
The below works for single id.
var myfilter = { groupOp: "AND", rules: []};
myfilter.rules.push({field: "id", op: "cn", data: "10016"});
var myGrid = $("#list_master").jqGrid();
myGrid[0].p.search = myfilter.rules.length>0;
$.extend(myGrid[0].p.postData,{filters:JSON.stringify(myfilter)});
myGrid.trigger("reloadGrid",[{page:1}]);
myGrid.setSelection("10016, true);
if I add another element it does not work
myfilter.rules.push({field: "id", op: "cn", data: "22222"});
Thanks
Glenn
2 Answers
You can use 'in' operator and comma sep vales.
myfilter.rules.push({field: "id", op: "in", data: "10016,12345,22222"});
Your Answer