]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - form/RealmComboBox.js
cleanly separate sources from package build, move to own folder
[proxmox-widget-toolkit.git] / form / RealmComboBox.js
diff --git a/form/RealmComboBox.js b/form/RealmComboBox.js
deleted file mode 100644 (file)
index 309bf4f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-Ext.define('Proxmox.form.RealmComboBox', {
-    extend: 'Ext.form.field.ComboBox',
-    alias: 'widget.pmxRealmComboBox',
-
-    controller: {
-       xclass: 'Ext.app.ViewController',
-
-       init: function(view) {
-           view.store.on('load', this.onLoad, view);
-       },
-
-       onLoad: function(store, records, success) {
-           if (!success) {
-               return;
-           }
-           let me = this;
-           let val = me.getValue();
-           if (!val || !me.store.findRecord('realm', val)) {
-               let def = 'pam';
-               Ext.each(records, function(rec) {
-                   if (rec.data && rec.data.default) {
-                       def = rec.data.realm;
-                   }
-               });
-               me.setValue(def);
-           }
-       },
-    },
-
-    fieldLabel: gettext('Realm'),
-    name: 'realm',
-    queryMode: 'local',
-    allowBlank: false,
-    editable: false,
-    forceSelection: true,
-    autoSelect: false,
-    triggerAction: 'all',
-    valueField: 'realm',
-    displayField: 'descr',
-    getState: function() {
-       return { value: this.getValue() };
-    },
-    applyState: function(state) {
-       if (state && state.value) {
-           this.setValue(state.value);
-       }
-    },
-    stateEvents: ['select'],
-    stateful: true, // last chosen auth realm is saved between page reloads
-    id: 'pveloginrealm', // We need stable ids when using stateful, not autogenerated
-    stateID: 'pveloginrealm',
-
-    store: {
-       model: 'pmx-domains',
-       autoLoad: true,
-    },
-});