i have a Jqgrid with 3 columns. I want to filter Status: Active records at Jqgrid load time.
at present it is loading all records. below is my ColModel
$("#Grid").jqGrid({
url: Link,
datatype: 'xml',
cache: false,
mtype: 'POST',
width: 610,
height: '100%',
colNames: ['Manager','User','Status'],
colModel: [
{name: 'Manager', index: 'Manager', width: 20, xmlmap: 'Manager', stype: 'select', searchoptions: {dataUrl: DataURL} },
{ name: 'User', index: 'User', width: 20, xmlmap: 'User'},
{ name: 'Status', index: 'Status', width: 17, xmlmap: 'Status',
stype:'select', searchoptions: {
defaultValue: "ACTIVE", value:":ALL;ACTIVE:ACTIVE;INACTIVE:INACTIVE;PENDING:PENDING" }},],
xmlReader: { repeatitems: false },
pager: '#pager',
rowNum: 10,
scrollOffset: 0,
cmTemplate: { sortable: true },
sortname: 'invid',
sortorder: 'desc',
viewrecords: true,
gridview: true,
loadonce: true,
shrinkToFit: true,
scroll: false,
If i use defaultValue: "ACTIVE" it's setting the select value as active but data is not filtering.
I tried filtering like below but it's not working.
filters: {
"groupOp":"AND","rules": [{ "field": "Status", "op": "eq", "data": "ACTIVE" }, { "field": "Manager", "op": "eq", "data": "ALL" }]},
search: true,
how to filter data by default Status as ACTIVE.