diff --git a/debian/changelog.Debian b/debian/changelog.Debian index dc8dc1d5..eaada9f3 100644 --- a/debian/changelog.Debian +++ b/debian/changelog.Debian @@ -4,6 +4,8 @@ pve-manager (4.1-32) unstable; urgency=medium * fix #143: add disk/mem percent sort + * fix #759: save columns of resourceGrid + -- Proxmox Support Team Wed, 20 Apr 2016 09:21:17 +0200 pve-manager (4.1-31) unstable; urgency=medium diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css index 8778aa1b..2f83863a 100644 --- a/www/css/ext6-pve.css +++ b/www/css/ext6-pve.css @@ -350,3 +350,16 @@ .x-form-display-field-default { min-height: 20px; } + +.x-button-reset:before { + font-size: 16px; +} + +/* for resetcolumnsbutton */ +.x-button-reset:after{ + content: "\f0e7 "; + position: relative; + text-shadow: 0 0 2px #fff; + left: -3px; + top: 2px; +} diff --git a/www/manager6/grid/ResourceGrid.js b/www/manager6/grid/ResourceGrid.js index b97711fc..560ae519 100644 --- a/www/manager6/grid/ResourceGrid.js +++ b/www/manager6/grid/ResourceGrid.js @@ -3,7 +3,14 @@ Ext.define('PVE.grid.ResourceGrid', { alias: ['widget.pveResourceGrid'], border: false, - + saveCurrentState: function(){ + var me = this; + me.saveState(); + }, + defaultSorter: { + property: 'type', + direction: 'ASC' + }, initComponent : function() { var me = this; @@ -14,12 +21,7 @@ Ext.define('PVE.grid.ResourceGrid', { var store = Ext.create('Ext.data.Store', { model: 'PVEResources', - sorters: [ - { - property : 'type', - direction: 'ASC' - } - ], + sorters: me.defaultSorter, proxy: { type: 'memory' } }); @@ -149,7 +151,21 @@ Ext.define('PVE.grid.ResourceGrid', { Ext.apply(me, { store: store, + stateful: true, + stateId: 'resourcegrid', tbar: [ + { + xtype: 'button', + itemId: 'resetbutton', + tooltip: gettext("Reset Columns"), + iconCls: 'fa fa-fw fa-columns x-button-reset', + handler: function(button, e, opts) { + var sp = Ext.state.Manager.getProvider(); + me.getStore().sort(me.defaultSorter); + me.reconfigure(null, PVE.data.ResourceStore.defaultColums()); + sp.clear(me.stateId); + } + }, '->', gettext('Search') + ':', ' ', { @@ -206,13 +222,15 @@ Ext.define('PVE.grid.ResourceGrid', { }, destroy: function() { rstore.un("load", load_cb); - } + }, + columnschanged: 'saveCurrentState', + columnresize: 'saveCurrentState', + columnmove: 'saveCurrentState', + sortchange: 'saveCurrentState', }, columns: coldef }); - me.callParent(); - updateGrid(); rstore.on("load", load_cb); }