Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
633 views
in Technique[技术] by (71.8m points)

asp.net mvc - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)} : {},

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...