public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit v2 1/4] ObjectGrid: optionally show loading mask on load
Date: Wed,  6 Jul 2022 15:01:23 +0200	[thread overview]
Message-ID: <20220706130126.282308-2-a.lauterer@proxmox.com> (raw)
In-Reply-To: <20220706130126.282308-1-a.lauterer@proxmox.com>

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---

changes since v1:
- added description in the documention at the top
- renamed paramter to "maskOnLoad" as I couldn't come up with something
more fitting ;)

 src/grid/ObjectGrid.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/grid/ObjectGrid.js b/src/grid/ObjectGrid.js
index b355d6d..065a009 100644
--- a/src/grid/ObjectGrid.js
+++ b/src/grid/ObjectGrid.js
@@ -39,6 +39,8 @@ disabled:: setting this parameter to true will disable selection and focus on
   the proxmoxObjectGrid as well as greying out input elements. Useful for a
   readonly tabular display
 
+maskOnLoad: if set to true, will show a "Loading..." while the store is loading data
+
 */
 Ext.define('Proxmox.grid.ObjectGrid', {
     extend: 'Ext.grid.GridPanel',
@@ -48,6 +50,8 @@ Ext.define('Proxmox.grid.ObjectGrid', {
     // see top-level doc-comment above for details/example
     gridRows: [],
 
+    maskOnLoad: false,
+
     disabled: false,
     hideHeaders: true,
 
@@ -221,7 +225,10 @@ Ext.define('Proxmox.grid.ObjectGrid', {
 
     reload: function() {
 	let me = this;
-	me.rstore.load();
+	if (me.maskOnLoad) {
+	    me.setLoading();
+	}
+	me.rstore.load({ callback: () => me.setLoading(false) });
     },
 
     getObjectValue: function(key, defaultValue) {
-- 
2.30.2





  reply	other threads:[~2022-07-06 13:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 13:01 [pve-devel] [PATCH widget-toolkit/manager v2 0/4] Ceph OSD: add detail infos Aaron Lauterer
2022-07-06 13:01 ` Aaron Lauterer [this message]
2022-10-17 14:29   ` [pve-devel] [PATCH widget-toolkit v2 1/4] ObjectGrid: optionally show loading mask on load Dominik Csapak
2022-07-06 13:01 ` [pve-devel] [PATCH manager v2 2/4] api ceph osd: add OSD index, metadata and lv-info Aaron Lauterer
2022-10-17 14:29   ` Dominik Csapak
2022-07-06 13:01 ` [pve-devel] [PATCH manager v2 3/4] ui utils: add renderer for ceph osd addresses Aaron Lauterer
2022-10-17 14:29   ` Dominik Csapak
2022-07-06 13:01 ` [pve-devel] [PATCH manager v2 4/4] ui: osd: add details window Aaron Lauterer
2022-10-17 14:30   ` Dominik Csapak
2022-10-12 12:09 ` [pve-devel] [PATCH widget-toolkit/manager v2 0/4] Ceph OSD: add detail infos Aaron Lauterer
2022-10-17 14:29 ` Dominik Csapak
2022-10-18  9:14   ` Aaron Lauterer
2022-10-19  6:46     ` Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706130126.282308-2-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal