Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have kendo grid on page and i want to preserve filter states throught application..i have done that by using cookies..i am getting cookie values as

"{"filter":{"filters":[{"field":"assign_by","operator":"contains","value":"o"},{"field":"assign_by","operator":"contains","value":"k"}],"logic":"or"}}"

but how to reapply these filter values to grid

//storing cookies on other function
function valuechange(){
var dataSource = gview.dataSource;
gridfilter = kendo.stringify({
filter: dataSource.filter()
});

$.cookie("gridState", gridfilter);
}
//retriving cookies
C#
function dataBound(e) {
            var scrollVal = $("#scrollVal").val();
            var gview = $("#grid").data("kendoGrid");
            gview.content.scrollTop(scrollVal);
            if ($.cookie('gridState')) {
                var gridState = unescape(document.cookie);
                var filtergrid = gridState.split("=");

                var filtergridval = filtergrid[1];
                var filterval = filtergridval.split(",");
// filterval gives above cokie i metntioned

}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900