]> git.proxmox.com Git - proxmox-widget-toolkit.git/blame - form/TextField.js
use eslint and execute as check target
[proxmox-widget-toolkit.git] / form / TextField.js
CommitLineData
2cebd14b 1Ext.define('Proxmox.form.field.Textfield', {
a0ec1620
DM
2 extend: 'Ext.form.field.Text',
3 alias: ['widget.proxmoxtextfield'],
4
f0372135
DM
5 config: {
6 skipEmptyText: true,
a0ec1620 7
f0372135
DM
8 deleteEmpty: false,
9 },
a0ec1620
DM
10
11 getSubmitData: function() {
05a977a2 12 let me = this,
a0ec1620
DM
13 data = null,
14 val;
15 if (!me.disabled && me.submitValue && !me.isFileUpload()) {
16 val = me.getSubmitValue();
17 if (val !== null) {
18 data = {};
19 data[me.getName()] = val;
f0372135 20 } else if (me.getDeleteEmpty()) {
a0ec1620 21 data = {};
01031528 22 data.delete = me.getName();
a0ec1620
DM
23 }
24 }
25 return data;
26 },
27
28 getSubmitValue: function() {
05a977a2 29 let me = this;
a0ec1620 30
05a977a2 31 let value = this.processRawValue(this.getRawValue());
a0ec1620
DM
32 if (value !== '') {
33 return value;
34 }
35
f0372135 36 return me.getSkipEmptyText() ? null: value;
ec079868
TL
37 },
38
39 setAllowBlank: function(allowBlank) {
40 this.allowBlank = allowBlank;
b69c301a 41 this.validate();
01031528 42 },
a0ec1620 43});