From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit v2 1/1] RealmComboBox: add custom store filters for callers
Date: Tue, 6 Dec 2022 12:06:32 +0100 [thread overview]
Message-ID: <20221206110635.1885744-4-d.csapak@proxmox.com> (raw)
In-Reply-To: <20221206110635.1885744-1-d.csapak@proxmox.com>
so that a user can filter the underlying store, e.g. for type
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/form/RealmComboBox.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/form/RealmComboBox.js b/src/form/RealmComboBox.js
index 5f61687..c57b52d 100644
--- a/src/form/RealmComboBox.js
+++ b/src/form/RealmComboBox.js
@@ -6,7 +6,12 @@ Ext.define('Proxmox.form.RealmComboBox', {
xclass: 'Ext.app.ViewController',
init: function(view) {
- view.store.on('load', this.onLoad, view);
+ let store = view.getStore();
+ if (view.storeFilter) {
+ store.setFilters(view.storeFilter);
+ }
+ store.on('load', this.onLoad, view);
+ store.load();
},
onLoad: function(store, records, success) {
@@ -27,6 +32,9 @@ Ext.define('Proxmox.form.RealmComboBox', {
},
},
+ // define custom filters for the underlying store
+ storeFilter: undefined,
+
fieldLabel: gettext('Realm'),
name: 'realm',
queryMode: 'local',
@@ -52,6 +60,6 @@ Ext.define('Proxmox.form.RealmComboBox', {
store: {
model: 'pmx-domains',
- autoLoad: true,
+ autoLoad: false,
},
});
--
2.30.2
next prev parent reply other threads:[~2022-12-06 11:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 11:06 [pve-devel] [PATCH access-control/wt/manager v2] add realm sync jobs Dominik Csapak
2022-12-06 11:06 ` [pve-devel] [PATCH access-control v2 1/2] realm: sync: allow 'none' for 'remove-vanished' option Dominik Csapak
2022-12-14 11:16 ` [pve-devel] applied: " Thomas Lamprecht
2022-12-06 11:06 ` [pve-devel] [PATCH access-control v2 2/2] add realmsync plugin for jobs and CRUD api for domainsync-jobs Dominik Csapak
2022-12-13 13:43 ` Thomas Lamprecht
2022-12-14 9:53 ` Dominik Csapak
2022-12-06 11:06 ` Dominik Csapak [this message]
2022-12-06 11:06 ` [pve-devel] [PATCH manager v2 1/3] ui: realm: sync: don't use realm defaults for remove-vanished Dominik Csapak
2022-12-06 11:08 ` Dominik Csapak
2022-12-13 14:15 ` [pve-devel] applied: " Thomas Lamprecht
2022-12-14 9:42 ` Dominik Csapak
2022-12-06 11:06 ` [pve-devel] [PATCH manager v2 2/3] Jobs: add RealmSync Plugin and register it Dominik Csapak
2022-12-06 11:06 ` [pve-devel] [PATCH manager v2 3/3] ui: add Realm Sync panel 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=20221206110635.1885744-4-d.csapak@proxmox.com \
--to=d.csapak@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