[pve-devel] [PATCH manager 01/10] remove reset columns button from resource grid

Dominik Csapak d.csapak at proxmox.com
Tue Nov 8 10:50:42 CET 2016


since we now have the client settings, we do not need this anymore

also rename the stateid to 'grid-resource'
(we want to establish a convention to differentiate between saved local
storage items)

the whole saveCurrentState logic was not really necessary, so we can drop this too

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/grid/ResourceGrid.js | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/www/manager6/grid/ResourceGrid.js b/www/manager6/grid/ResourceGrid.js
index ad6f05d..c73651c 100644
--- a/www/manager6/grid/ResourceGrid.js
+++ b/www/manager6/grid/ResourceGrid.js
@@ -3,10 +3,6 @@ Ext.define('PVE.grid.ResourceGrid', {
     alias: ['widget.pveResourceGrid'],
 
     border: false,
-    saveCurrentState: function(){
-	var me = this;
-	me.saveState();
-    },
     defaultSorter: {
 	property: 'type',
 	direction: 'ASC'
@@ -152,20 +148,8 @@ Ext.define('PVE.grid.ResourceGrid', {
 	Ext.apply(me, {
 	    store: store,
 	    stateful: true,
-	    stateId: 'resourcegrid',
+	    stateId: 'grid-resource',
 	    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') + ':', ' ',
 		{
@@ -193,11 +177,7 @@ Ext.define('PVE.grid.ResourceGrid', {
 		},
 		destroy: function() {
 		    rstore.un("load", load_cb);
-		},
-		columnschanged: 'saveCurrentState',
-		columnresize: 'saveCurrentState',
-		columnmove: 'saveCurrentState',
-		sortchange: 'saveCurrentState'
+		}
 	    },
             columns: coldef
 	});
-- 
2.1.4





More information about the pve-devel mailing list