[pve-devel] [PATCH 3/3] replace object creation via 'new' with ExtJS methods

Emmanuel Kasper e.kasper at proxmox.com
Tue Jan 26 17:15:55 CET 2016


This makes the code more homogeneous and allows us to use the ExtJS
class autoloader in the future if we want (autoloader idea: ExtJS tries to load the
JS class file over HTTP based on the class name, no need to maintain a list
of includes)
---
 www/manager6/Workspace.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
index 57a66ac..a807b41 100644
--- a/www/manager6/Workspace.js
+++ b/www/manager6/Workspace.js
@@ -275,12 +275,13 @@ Ext.define('PVE.StdWorkspace', {
 	var sprovider = Ext.create('PVE.StateProvider');
 	Ext.state.Manager.setProvider(sprovider);
 
-	var selview = new PVE.form.ViewSelector({});
+	var selview = Ext.create('PVE.form.ViewSelector');
 
 	var rtree = Ext.createWidget('pveResourceTree', {
 	    viewFilter: selview.getViewFilter(),
 	    flex: 1,
-	    selModel: new Ext.selection.TreeModel({
+	    selModel: {
+		selType: 'treemodel',
 		listeners: {
 		    selectionchange: function(sm, selected) {
 			var comp;
@@ -311,7 +312,7 @@ Ext.define('PVE.StdWorkspace', {
 			me.setContent(comp);
 		    }
 		}
-	    })
+	    }
 	});
 
 	selview.on('select', function(combo, records) { 
-- 
2.1.4





More information about the pve-devel mailing list