snapshottree: remove sorter before saving the state

extjs saves the state including the sorter, but cannot serialize the
sorter function. when restoring the state, it is not a valid sorter,
so we delete it before saving

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-12-06 16:26:40 +01:00 committed by Dietmar Maurer
parent b35f19a3dc
commit 90ba9a4e02
2 changed files with 18 additions and 0 deletions

View File

@ -96,6 +96,15 @@ Ext.define('PVE.lxc.SnapshotTree', {
},
listeners: {
beforestatesave: function(grid, state, eopts) {
// extjs cannot serialize functions,
// so a the sorter with only the sorterFn will
// not be a valid sorter when restoring the state
delete state.storeState.sorters;
}
},
initComponent: function() {
var me = this;

View File

@ -94,6 +94,15 @@ Ext.define('PVE.qemu.SnapshotTree', {
},
listeners: {
beforestatesave: function(grid, state, eopts) {
// extjs cannot serialize functions,
// so a the sorter with only the sorterFn will
// not be a valid sorter when restoring the state
delete state.storeState.sorters;
}
},
initComponent: function() {
var me = this;