[pve-devel] [PATCH widget-toolkit 1/1] add returnCompleteRecord to ObjectStore

Dominik Csapak d.csapak at proxmox.com
Fri Apr 27 12:28:32 CEST 2018


this can be useful when needing multiple fields

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 data/ObjectStore.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/data/ObjectStore.js b/data/ObjectStore.js
index 1e3771f..ec35cbf 100644
--- a/data/ObjectStore.js
+++ b/data/ObjectStore.js
@@ -6,6 +6,16 @@
 Ext.define('Proxmox.data.ObjectStore',  {
     extend: 'Proxmox.data.UpdateStore',
 
+    returnCompleteRecord: function() {
+	var me = this;
+	var record = Ext.create('Ext.data.Model');
+	me.getData().each(function(item) {
+	    record.set(item.data.key, item.data.value);
+	});
+	record.commit(true);
+	return record;
+    },
+
     constructor: function(config) {
 	var me = this;
 
-- 
2.11.0





More information about the pve-devel mailing list