mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-29 06:21:16 +00:00
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:
parent
3501ca3fc9
commit
a1177796f9
@ -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,
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user