rename integerfield to pveintegerfiled, implement deleteEmpty

This commit is contained in:
Dietmar Maurer 2017-02-24 08:59:06 +01:00
parent d44fdf59f9
commit 2cebd14b9d
2 changed files with 24 additions and 4 deletions

View File

@ -1,8 +1,28 @@
Ext.define('Ext.form.field.Integer',{
Ext.define('Proxmox.form.field.Integer',{
extend: 'Ext.form.field.Number',
alias: 'widget.integerfield',
alias: 'widget.pveintegerfield',
allowDecimals: false,
allowExponential: false,
step: 1
step: 1,
deleteEmpty: false,
getSubmitData: function() {
var me = this,
data = null,
val;
if (!me.disabled && me.submitValue && !me.isFileUpload()) {
val = me.getSubmitValue();
if (val !== undefined && val !== null && val !== '') {
data = {};
data[me.getName()] = val;
} else if (me.deleteEmpty) {
data = {};
data['delete'] = me.getName();
}
}
return data;
}
});

View File

@ -1,4 +1,4 @@
Ext.define('Proxmox.form.Textfield', {
Ext.define('Proxmox.form.field.Textfield', {
extend: 'Ext.form.field.Text',
alias: ['widget.proxmoxtextfield'],