Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to programatically set a filter in jquery jqgrid?

i have a page with a jqgrid on it with filter row at the top. I want to have a link on another page that loads this grid page but with a filter set on one of the columns. is that possible to do from a link or any other workaround people can suggest?

like image 758
leora Avatar asked Jul 22 '10 18:07

leora


1 Answers

the way i solved this was to pass in the following code:

var myfilter = { groupOp: "AND", rules: [] };
myfilter.rules.push({ field: "DataIssuesYN", op: "eq", data: "Y" });

and then in the jqGrid setup, I pass into postData:

  postData: (myfilter) ? { filters: JSON.stringify(myfilter)} : {},
like image 145
leora Avatar answered Nov 02 '22 04:11

leora