From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH] ui: datastore: Add basic expand/collapse all button
Date: Mon, 13 Jul 2020 14:03:47 +0200 [thread overview]
Message-ID: <20200713120347.25811-1-a.lauterer@proxmox.com> (raw)
The parent component to the tree grid (tab.panel) does not understand
the Ext.panel.Tool class which would usually be used in such a
situation.
As a workaround a simple button (right aligned) in the tbar section has
to do the job for now.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
www/DataStoreContent.js | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/www/DataStoreContent.js b/www/DataStoreContent.js
index a29436fc..cac0b481 100644
--- a/www/DataStoreContent.js
+++ b/www/DataStoreContent.js
@@ -47,6 +47,8 @@ Ext.define('PBS.DataStoreContent', {
title: gettext('Content'),
+ isExpanded: false,
+
controller: {
xclass: 'Ext.app.ViewController',
@@ -321,7 +323,22 @@ Ext.define('PBS.DataStoreContent', {
'backup-time': (time.getTime()/1000).toFixed(0),
'backup-type': type,
}).show();
- }
+ },
+
+ expandCollapseAll: function (button) {
+ let me = this;
+ let view = me.getView();
+
+ if (me.isExpanded) {
+ view.collapseAll();
+ me.isExpanded = false;
+ button.setText(gettext('Expand All'));
+ } else {
+ view.expandAll();
+ me.isExpanded = true;
+ button.setText(gettext('Collapse All'));
+ }
+ },
},
columns: [
@@ -446,6 +463,12 @@ Ext.define('PBS.DataStoreContent', {
enableFn: function(record) {
return !!record.data.leaf && record.size !== null && record.data.files.some(el => el.filename.endsWith('pxar.didx'));
},
- }
+ },
+ '->',
+ {
+ xtype: "proxmoxButton",
+ text: gettext('Expand All'),
+ handler: 'expandCollapseAll',
+ },
],
});
--
2.20.1
next reply other threads:[~2020-07-13 12:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 12:03 Aaron Lauterer [this message]
2020-07-13 12:28 ` Aaron Lauterer
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=20200713120347.25811-1-a.lauterer@proxmox.com \
--to=a.lauterer@proxmox.com \
--cc=pbs-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.