[pve-devel] r5922 - pve-manager/pve2/www/new/qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Fri May 6 14:41:25 CEST 2011


Author: dietmar
Date: 2011-05-06 14:41:25 +0200 (Fri, 06 May 2011)
New Revision: 5922

Modified:
   pve-manager/pve2/www/new/qemu/CreateWizard.js
Log:
add nice summary


Modified: pve-manager/pve2/www/new/qemu/CreateWizard.js
===================================================================
--- pve-manager/pve2/www/new/qemu/CreateWizard.js	2011-05-06 11:48:23 UTC (rev 5921)
+++ pve-manager/pve2/www/new/qemu/CreateWizard.js	2011-05-06 12:41:25 UTC (rev 5922)
@@ -10,6 +10,16 @@
 
 	var nextvmid = PVE.data.ResourceStore.findNextVMID();
 
+	var summarystore = Ext.create('Ext.data.Store', {
+	    model: 'KeyValue',
+	    sorters: [
+		{
+		    property : 'key',
+		    direction: 'ASC'
+		}
+	    ]
+	});
+
 	var cdfilesel = Ext.create('PVE.form.FileSelector', {
 	    name: 'cdimage',
 	    storageContent: 'iso',
@@ -312,25 +322,43 @@
 		},
 		{
 		    title: 'Confirm',
-		    layout: 'fit',
+		    layout: {
+			type: 'vbox',
+			align: 'stretch'
+		    },
+		    items: [
+			{
+			    html: "Settings:",
+			    border: false
+			},
+			{
+			    xtype: 'grid',
+			    store: summarystore,
+			    columns: [
+				{header: 'Key', width: 150, dataIndex: 'key'},
+				{header: 'Value', flex: 1, dataIndex: 'value'}
+			    ]
+			}
+		    ],
 		    listeners: {
 			show: function() {
 			    var form = me.down('form').getForm();
 			    var kv = me.getFieldValues();
-			    var html = '';
+			    var data = [];
 			    Ext.Object.each(kv, function(key, value) {
-				html += Ext.htmlEncode(key) + ": " +
-				    Ext.htmlEncode(Ext.JSON.encode(value)) + '<br>';
+				var html = Ext.htmlEncode(Ext.JSON.encode(value));
+				data.push({ key: key, value: value });
 			    });
-			    this.update(html);
+			    summarystore.removeAll();
+			    summarystore.add(data);
+			    summarystore.sort();
 			}
 		    },
 		    onSubmit: function() {
 			//var form = me.down('form').getForm();
 			var kv = me.getFieldValues();
 			console.dir(kv);
-		    },
-		    html: 'no content'
+		    }
 		}
 	    ]
 	});




More information about the pve-devel mailing list