pve-manager/www/manager6/form/GroupSelector.js
Emmanuel Kasper a13842bf0e Ext6migrate: move static configuration from instantiation time to class declaration time.
This fixes the problem that this ComboGrid was displayed with an empty value
( similar the to the Keyboard Selection and Realm Selection in the login window)
2016-01-22 11:24:24 +01:00

55 lines
875 B
JavaScript

Ext.define('PVE.form.GroupSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.pveGroupSelector'],
allowBlank: false,
autoSelect: false,
valueField: 'groupid',
displayField: 'groupid',
listConfig: {
columns: [
{
header: gettext('Group'),
sortable: true,
dataIndex: 'groupid',
flex: 1
},
{
header: gettext('Comment'),
sortable: false,
dataIndex: 'comment',
flex: 1
}
]
},
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
model: 'pve-groups'
});
Ext.apply(me, {
store: store,
});
me.callParent();
store.load();
}
}, function() {
Ext.define('pve-groups', {
extend: 'Ext.data.Model',
fields: [ 'groupid', 'comment' ],
proxy: {
type: 'pve',
url: "/api2/json/access/groups"
},
idProperty: 'groupid'
});
});