We have a grid that has different columns for different user roles. We have a requirement to persist filters. The problem we are running into is that user A is an admin and sees their specified columns and logs out, user B who is not an admin on the same computer is seeing the admin columns instead of the columns they are supposed to see. Is there any way to just persist filters?
The secondary problem is when we publish updates to the website the grid does not reflect our changes due to the persistence. This could be a serious problem.
We are using:
$(document).ready(function () {
$("div[data-role='grid']").each(function (index, element) {
var grid = $(element).data("kendoGrid");
var key = location.pathname + '-' + element.id;
var options = localStorage[key];
if (options)
{
grid.setOptions(JSON.parse(options));
}
grid.dataSource.read();
})
})
$(window).on('beforeunload', function () {
$("div[data-role='grid']").each(function (index, element) {
var grid = $(element).data("kendoGrid");
var key = location.pathname + '-' + element.id;
localStorage[key] = kendo.stringify(grid.getOptions(grid.getOptions());
})
})