Dominik Csapak 7515e62236 ext6migrate: fix model behaviour for KVComboBox
we used an empty value for the Key-Value ComboBox for defaults.
With extjs6, if the idProperty of a model is empty, they generate
a name for it, which breaks our logic for submitting
(currently we checked if this is empty, and send a delete command
to our api)
instead, we use the value 'default' and check for it when we submit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-29 15:27:15 +01:00

18 lines
358 B
JavaScript

// boolean type including 'Default' (delete property from file)
Ext.define('PVE.form.Boolean', {
extend: 'PVE.form.KVComboBox',
alias: ['widget.booleanfield'],
initComponent: function() {
var me = this;
me.data = [
['__default__', gettext('Default')],
[1, gettext('Yes')],
[0, gettext('No')]
];
me.callParent();
}
});