fix HA Group Selector display

displayField must now be set in class body, take opportunity to move out
other config properties from initComponent()
This commit is contained in:
Emmanuel Kasper 2016-02-25 16:35:57 +01:00 committed by Dietmar Maurer
parent 9ccd656a61
commit 7fc52dff20

View File

@ -2,48 +2,42 @@ Ext.define('PVE.ha.GroupSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.pveHAGroupSelector'],
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
autoSelect: false,
valueField: 'group',
displayField: 'group',
listConfig: {
columns: [
{
header: gettext('Group'),
width: 100,
sortable: true,
dataIndex: 'group'
},
{
header: gettext('Nodes'),
width: 100,
sortable: false,
dataIndex: 'nodes'
},
{
header: gettext('Comment'),
flex: 1,
dataIndex: 'comment'
}
]
},
store: {
model: 'pve-ha-groups',
sorters: {
property: 'group',
order: 'DESC'
}
});
},
Ext.apply(me, {
store: store,
autoSelect: false,
valueField: 'group',
displayField: 'group',
listConfig: {
columns: [
{
header: gettext('Group'),
width: 100,
sortable: true,
dataIndex: 'group'
},
{
header: gettext('Nodes'),
width: 100,
sortable: false,
dataIndex: 'nodes'
},
{
header: gettext('Comment'),
flex: 1,
dataIndex: 'comment'
}
]
}
});
me.callParent();
store.load();
initComponent: function() {
var me = this;
me.callParent();
me.getStore().load();
}
}, function() {