I've set columns editor for the column "itpt_name" but after grid.setOptions it is broken
Here is the example http://dojo.telerik.com/EjIlI
You need to follow these steps to reproduse
1) Open http://dojo.telerik.com/EjIlI
2) Click "Run"
3) Double click in any Cell in column "Партия" (you can see working custom editor with the broken images, it is normal)
4) Set sorting for the column "Партия"
5) Save state using "Save state" button
6) Ctrl+F5
7) Load saved state
8) Double click in any Cell in column "Партия" (custom editor is broken, it is not normal)
Please advise why custom editor is broken
7 Answers, 1 is accepted
Here is an example from the Kendo API refference. It doesn`t work also
http://dojo.telerik.com/UsAGi
Please read the first bullet from big yellow note in the setOptions() documentation and let me know if you have additional questions.
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-setOptions
Regards,
Dimo
Telerik
Thank you. I've tried to set editors for the grid columns with restored settings, that was my error.
Here is the working example for others who have the same problem
http://dojo.telerik.com/IBOho
This should be a feature request. Where can I suggest and vote on this?
getOptions and setOptions should include ALL templates. I've just turned gray figuring this out and having to set all my view, editor and filterable cell templates.
I am sorry about your negative experience. You can submit your suggestions at
http://kendoui-feedback.telerik.com/
Regards,
Dimo
Telerik
This code is still working for me.
(merged from different solutions seen in the past) :
function saveGridPersistState(grid) {
if (grid) {
var dataSource = grid.dataSource;
var state = {
aggregate: dataSource.aggregate(),
filter: dataSource.filter(),
group: dataSource.group(),
page: dataSource.page(),
pageSize: dataSource.pageSize(),
sort: dataSource.sort()
};
$.sessionStorage.set("GridState" + "-" + grid.element.attr('id'), state);
if (grid.options.persistSelection)
$.sessionStorage.set("GridSelected" + "-" + grid.element.attr('id'), grid._selectedIds);
}
}
function loadGridPersistState(grid) {
if (grid) {
var state = $.sessionStorage.get("GridState" + "-" + grid.element.attr('id'));
if (state) {
if (state.filter) {
parseFilterDates(state.filter, grid.dataSource.options.schema.model.fields);
}
grid.dataSource.query(state);
ClearFilterContainer(grid);
var selected = $.sessionStorage.get("GridSelected" + "-" + grid.element.attr('id'));
if (grid.options.persistSelection && selected)
grid._selectedIds = selected;
}
}
}
function parseFilterDates(filter, fields) {
if (filter.filters) {
for (var i = 0; i < filter.filters.length; i++) {
parseFilterDates(filter.filters[i], fields);
}
}
else {
if (fields[filter.field].type === "date") {
filter.value = kendo.parseDate(filter.value);
}
}
}
function ClearFilterContainer(grid) {
var $grid = grid;
$grid.thead.find('th').each(function () {
var cell = $(this);
var multiCheckNS = '.kendoFilterMultiCheck';
var filterMenu = cell.data('kendoFilterMultiCheck');
if (filterMenu) {
var that = filterMenu;
if (that.checkSource.options.transport) {
that.checkSource.options.transport.read.cache = false;
that.checkSource = kendo.data.DataSource.create(that.options.checkSource);
that.checkSource.options.forceUnique = false;
if (that.checkSource.options.transport)
that.checkSource.options.transport.read.cache = false;
if (that.popup) {
that.popup.destroy();
that.popup = null;
}
if (that.container) {
that.container.unbind(multiCheckNS);
that.container.empty();
}
}
}
});
}
$(function () {
$.alwaysUseJsonInStorage(true);
});
Open :
http://dojo.telerik.com/@frederic.r/ORaKE/10