so that a user can filter the underlying store, e.g. for type

Signed-off-by: Dominik Csapak <d.csa...@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to