[pve-devel] r5781 - in pve-manager/pve2/www/new: . form

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Apr 5 06:32:03 CEST 2011


Author: dietmar
Date: 2011-04-05 06:32:00 +0200 (Tue, 05 Apr 2011)
New Revision: 5781

Modified:
   pve-manager/pve2/www/new/ResourceTree.js
   pve-manager/pve2/www/new/form/ViewSelector.js
Log:
fix view selector


Modified: pve-manager/pve2/www/new/ResourceTree.js
===================================================================
--- pve-manager/pve2/www/new/ResourceTree.js	2011-04-04 11:57:52 UTC (rev 5780)
+++ pve-manager/pve2/www/new/ResourceTree.js	2011-04-05 04:32:00 UTC (rev 5781)
@@ -66,7 +66,7 @@
 	var rstore = PVE.data.ResourceStore;
 
 	var pdata = {
-	    view: PVE.form.ViewSelector.defaultView,
+	    view: {},
 	    dataIndex: {},
 	    updateCount: 0
 	};
@@ -144,22 +144,23 @@
 	    pdata.updateCount++;
 	};
 
+	var selview = new PVE.form.ViewSelector({
+	    listeners: {
+		select: function(combo, records) { 
+		    if (records && records.length) {
+			var view = combo.getViewSettings();
+			self.setView(view);
+		    }
+		}
+	    }
+	});
+
+	pdata.view = selview.getViewSettings();
+
 	Ext.apply(self, {
 	    store: store,
             title: 'Resource Tree',
-	    tbar: [ ' ', 
-		{ 
-		    xtype: 'pveViewSelector',
-		    listeners: {
-			select: function(combo, records) { 
-			    if (records && records.length) {
-				var view = combo.getViewSettings();
-				self.setView(view);
-			    }
-			}
-		    }
-		}
-	    ],
+	    tbar: [ ' ', selview ],
 	    listeners: {
 		destroy: function() {
 		    rstore.un("load", updateTree)
@@ -173,10 +174,11 @@
 		pdata.view = view;
 
 		var rootnode = self.store.node;
-		//rootnode.collapse();
+		rootnode.collapse();
 		rootnode.removeAll(true);
 		pdata.dataIndex = {};
 		updateTree();
+		rootnode.expand();
 	    },
 
 	});

Modified: pve-manager/pve2/www/new/form/ViewSelector.js
===================================================================
--- pve-manager/pve2/www/new/form/ViewSelector.js	2011-04-04 11:57:52 UTC (rev 5780)
+++ pve-manager/pve2/www/new/form/ViewSelector.js	2011-04-05 04:32:00 UTC (rev 5781)
@@ -3,18 +3,14 @@
     requires: ['Ext.data.Store'],
     alias: ['widget.pveViewSelector'],
 
-    statics: {
-	defaultView: {
-	    text: 'Server View',
-	    groups: ['node']
-	}
-    },
-
     initComponent: function() {
 	var self = this;
 
 	var default_views = {
-	    server: self.statics().defaultView,
+	    server: {
+		text: 'Server View',
+		groups: ['node']
+	    },
 	    folder: {
 		text: 'Folder View',
 		groups: ['type']




More information about the pve-devel mailing list