mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 12:02:14 +00:00
copy KVComboBox.js from manager to manager5
This commit is contained in:
parent
c45bc501bc
commit
f134c46d4f
44
www/manager5/form/KVComboBox.js
Normal file
44
www/manager5/form/KVComboBox.js
Normal file
@ -0,0 +1,44 @@
|
||||
Ext.define('PVE.form.KVComboBox', {
|
||||
extend: 'Ext.form.field.ComboBox',
|
||||
alias: 'widget.pveKVComboBox',
|
||||
|
||||
deleteEmpty: true,
|
||||
|
||||
getSubmitData: function() {
|
||||
var me = this,
|
||||
data = null,
|
||||
val;
|
||||
if (!me.disabled && me.submitValue) {
|
||||
val = me.getSubmitValue();
|
||||
if (val !== null && val !== '') {
|
||||
data = {};
|
||||
data[me.getName()] = val;
|
||||
} else if (me.deleteEmpty) {
|
||||
data = {};
|
||||
data['delete'] = me.getName();
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
me.store = Ext.create('Ext.data.ArrayStore', {
|
||||
model: 'KeyValue',
|
||||
data : me.data
|
||||
});
|
||||
|
||||
if (me.initialConfig.editable === undefined) {
|
||||
me.editable = false;
|
||||
}
|
||||
|
||||
Ext.apply(me, {
|
||||
displayField: 'value',
|
||||
valueField: 'key',
|
||||
queryMode: 'local'
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user