Filter jqGrid Data by Date Range?
I am trying to filter the jqGrid data by date range - that is, by "dateFrom" and "DateTo". Once the date is selected, I have tried to implement:
var dateFilter = {
groupOp: "AND",
rules: [
{ "field": "date", "op": "ge", "data": dateFrom },
{ "field": "date", "op": "le", "data": dateTo }
]
}
jQuery('#' + gridId).jqGrid('setGridParam', {
postData: {
filters: JSON.strin开发者_StackOverflow中文版gify(dateFilter)
}
}).trigger("reloadGrid");
But this doesn't seem to work ? I am using ASP.NET MVC but had hoped to do this on the client side by simply filtering the data to between the selected dates ?
Can anyone assist ?
If I understand you correct the old demo from the answer and another demo from the answer will gives you code fragments which you need. Here you could find additionally examples how to construct the filters
dynamically.
精彩评论