I have a kendo grid on my webpage and I am trying to programmatically save grid filters with sessionStorage, and this works for the most part.
The problem that I am facing is that when I put the filter in the date column, when I try to re-apply this filter, when the user goes to this page, it throws an error in one of the anonymous b / c functions, the method toLowerCase()does not exist. The filter works fine if I filter the columns of rows. I can apply several filters and save them in sessionStoragevar and reapply to the grid just fine. I only have problems with date columns.
It took me a while to figure out how to get kendo mesh filters using the syntax:
var theKgridFilters = $("#gridList").data("kendoGrid").dataSource.filter();
Then, to save it to sessionStoragevar, I had stringify()an object, otherwise it will not contain mesh filters in this var:
sessionStorage.setItem('theGridFilters', JSON.stringify(theKgridFilters));
Then, to reapply the filter in the grid, I had to convert the string back to a JSON b / c object, the filter is an object with attributes, so I used this:
if (sessionStorage.theGridFilters) {
gridFilter = sessionStorage.theGridFilters;
gridFilter = $.parseJSON(gridFilter);
}
which applies to the grid data filter attribute:
filter: gridFilter,
When I filter the grid in the date column, the error is displayed on this line below:
function anonymous(d, __f, __o) {
return (d.Last_Modified_Date.toLowerCase() == '2013-01-25t06:00:00.000z')
}
If the field is with a filter Last_Modified_Date. I am new to jQuery, JS, etc., and from what I read, anonymous () fns are created on the fly, so I don’t believe that I can change this.
, - toString() toLowerCase(). , , , , . , kendo.web.js IE.
, :
d.Last_Modified_Date Wed Jan 25 00:00:00 CST 2013 Object, (Date)
, , fn, : '2013-01-25t06:00:00.000z'.
, , - , . . , , , .
,
!