From 90ba9a4e021aaa72e0b61a9f90b8abd53444447a Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 6 Dec 2016 16:26:40 +0100 Subject: [PATCH] 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 --- www/manager6/lxc/SnapshotTree.js | 9 +++++++++ www/manager6/qemu/SnapshotTree.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/www/manager6/lxc/SnapshotTree.js b/www/manager6/lxc/SnapshotTree.js index 8969e974..df5b31cf 100644 --- a/www/manager6/lxc/SnapshotTree.js +++ b/www/manager6/lxc/SnapshotTree.js @@ -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; diff --git a/www/manager6/qemu/SnapshotTree.js b/www/manager6/qemu/SnapshotTree.js index c35b9c0c..ea14d0fe 100644 --- a/www/manager6/qemu/SnapshotTree.js +++ b/www/manager6/qemu/SnapshotTree.js @@ -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;