Commit bf6b27eb authored by Emmanuel Kasper's avatar Emmanuel Kasper Committed by Dietmar Maurer

ext5migrate: pass the items we want in the ComboBox as a config property

Since ExtJS5, when doing such a declaration,

	Ext.applyIf(me, {
	    items: {
		xtype: 'pveKVComboBox',
		comboItems: data,
	    }
	});

the comboItems property is passed in the parent class as a config object,
instead of being directly available via this.comboItems

Since using a config object is the recommended way of passing parameters
int the ExtJS class model, adapt the parent class to use the new paradigm.
parent 31b275d9
......@@ -62,9 +62,9 @@ Ext.define('PVE.dc.ConsoleViewerEdit', {
items: {
xtype: 'pveKVComboBox',
name: 'console',
data: data,
value: '',
fieldLabel: gettext('Console Viewer')
fieldLabel: gettext('Console Viewer'),
comboItems: data,
}
});
......
/* Key-Value ComboBox
*
* config properties:
* comboItems: an array of Key - Value pairs
*/
Ext.define('PVE.form.KVComboBox', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.pveKVComboBox',
deleteEmpty: true,
config: {
comboItems: undefined
},
getSubmitData: function() {
var me = this,
data = null,
......@@ -26,7 +34,7 @@ Ext.define('PVE.form.KVComboBox', {
me.store = Ext.create('Ext.data.ArrayStore', {
model: 'KeyValue',
data : me.data
data : me.getConfig('comboItems'),
});
if (me.initialConfig.editable === undefined) {
......
Ext.define('PVE.form.LanguageSelector', {
extend: 'PVE.form.KVComboBox',
alias: ['widget.pveLanguageSelector'],
initComponent: function() {
var me = this;
me.data = PVE.Utils.language_array();
me.callParent();
config: {
comboItems: PVE.Utils.language_array()
}
});
Ext.define('PVE.form.VNCKeyboardSelector', {
extend: 'PVE.form.KVComboBox',
alias: ['widget.VNCKeyboardSelector'],
initComponent: function() {
var me = this;
me.data = PVE.Utils.kvm_keymap_array();
me.callParent();
config: {
comboItems: PVE.Utils.kvm_keymap_array()
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment