[pve-devel] [PATCH pve-manager 1/2] Add documentation header for ObjectGrid.js
Emmanuel Kasper
e.kasper at proxmox.com
Wed Feb 24 10:53:51 CET 2016
also enhance the documentation header for DiffStore and UpdateStore
---
www/manager6/data/DiffStore.js | 12 +++++++-----
www/manager6/data/UpdateStore.js | 3 +++
www/manager6/grid/ObjectGrid.js | 14 ++++++++++++++
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/www/manager6/data/DiffStore.js b/www/manager6/data/DiffStore.js
index 66bcfed..a71a60e 100644
--- a/www/manager6/data/DiffStore.js
+++ b/www/manager6/data/DiffStore.js
@@ -1,11 +1,12 @@
/*
- * The DiffStore acts as proxy between an UpdateStore instance and a component.
+ * The DiffStore is a in-memory store acting as proxy between a real store
+ * instance and a component.
* Its purpose is to redisplay the component *only* if the data has been changed
- * inside the UpdateStore, to avoid the annoying visual flickering of using
- * the UpdateStore directly.
+ * inside the real store, to avoid the annoying visual flickering of using
+ * the real store directly.
*
* Implementation:
- * The DiffStore monitors via mon() the 'load' events sent by the target store.
+ * The DiffStore monitors via mon() the 'load' events sent by the real store.
* On each 'load' event, the DiffStore compares its own content with the target
* store (call to cond_add_item()) and then fires a 'refresh' event.
* The 'refresh' event will automatically trigger a view refresh on the component
@@ -13,8 +14,9 @@
*/
/* Config properties:
- * rstore: A target store to track changes
+ * rstore: the realstore which will autorefresh its content from the API
* Only works if rstore has a model and use 'idProperty'
+ * sortAfterUpdate: sort the diffstore before rendering the view
*/
Ext.define('PVE.data.DiffStore', {
extend: 'Ext.data.Store',
diff --git a/www/manager6/data/UpdateStore.js b/www/manager6/data/UpdateStore.js
index bf48611..72683fe 100644
--- a/www/manager6/data/UpdateStore.js
+++ b/www/manager6/data/UpdateStore.js
@@ -3,6 +3,9 @@
* to refresh the store data in the background
* Components using this store directly will flicker
* due to the redisplay of the element ater 'config.interval' ms
+ *
+ * Note that you have to call yourself startUpdate() for the background load
+ * to begin
*/
Ext.define('PVE.data.UpdateStore', {
extend: 'Ext.data.Store',
diff --git a/www/manager6/grid/ObjectGrid.js b/www/manager6/grid/ObjectGrid.js
index 8513709..e59dc00 100644
--- a/www/manager6/grid/ObjectGrid.js
+++ b/www/manager6/grid/ObjectGrid.js
@@ -1,3 +1,17 @@
+/* Renders a list of key values objets
+
+mandatory config parameters:
+rows: an object container where each propery is a key-value object we want to render
+ var rows = {
+ keyboard: {
+ header: gettext('Keyboard Layout'),
+ editor: 'PVE.dc.KeyboardEdit',
+ renderer: PVE.Utils.render_kvm_language,
+ required: true
+ },
+
+*/
+
Ext.define('PVE.grid.ObjectGrid', {
extend: 'Ext.grid.GridPanel',
alias: ['widget.pveObjectGrid'],
--
2.1.4
More information about the pve-devel
mailing list