auth-realm selector: add custom store filters for callers

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

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-01-17 12:46:55 +01:00 committed by Thomas Lamprecht
parent 3501ca3fc9
commit a1177796f9

View File

@ -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,
},
});