mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-30 17:14:28 +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',
|
xclass: 'Ext.app.ViewController',
|
||||||
|
|
||||||
init: function(view) {
|
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) {
|
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'),
|
fieldLabel: gettext('Realm'),
|
||||||
name: 'realm',
|
name: 'realm',
|
||||||
queryMode: 'local',
|
queryMode: 'local',
|
||||||
@ -52,6 +60,6 @@ Ext.define('Proxmox.form.RealmComboBox', {
|
|||||||
|
|
||||||
store: {
|
store: {
|
||||||
model: 'pmx-domains',
|
model: 'pmx-domains',
|
||||||
autoLoad: true,
|
autoLoad: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user