]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - form/RealmComboBox.js
1 Ext
.define('Proxmox.form.RealmComboBox', {
2 extend
: 'Ext.form.field.ComboBox',
3 alias
: 'widget.pmxRealmComboBox',
6 xclass
: 'Ext.app.ViewController',
9 view
.store
.on('load', this.onLoad
, view
);
12 onLoad: function(store
, records
, success
) {
17 var val
= me
.getValue();
18 if (!val
|| !me
.store
.findRecord('realm', val
)) {
20 Ext
.each(records
, function(rec
) {
21 if (rec
.data
&& rec
.data
.default) {
30 fieldLabel
: gettext('Realm'),
39 displayField
: 'descr',
40 getState: function() {
41 return { value
: this.getValue() };
43 applyState: function(state
) {
44 if (state
&& state
.value
) {
45 this.setValue(state
.value
);
48 stateEvents
: ['select'],
49 stateful
: true, // last chosen auth realm is saved between page reloads
50 id
: 'pveloginrealm', // We need stable ids when using stateful, not autogenerated
51 stateID
: 'pveloginrealm',