]>
Commit | Line | Data |
---|---|---|
2cebd14b | 1 | Ext.define('Proxmox.form.field.Textfield', { |
a0ec1620 DM |
2 | extend: 'Ext.form.field.Text', |
3 | alias: ['widget.proxmoxtextfield'], | |
4 | ||
5 | skipEmptyText: true, | |
6 | ||
7 | deleteEmpty: false, | |
8 | ||
9 | getSubmitData: function() { | |
10 | var me = this, | |
11 | data = null, | |
12 | val; | |
13 | if (!me.disabled && me.submitValue && !me.isFileUpload()) { | |
14 | val = me.getSubmitValue(); | |
15 | if (val !== null) { | |
16 | data = {}; | |
17 | data[me.getName()] = val; | |
18 | } else if (me.deleteEmpty) { | |
19 | data = {}; | |
20 | data['delete'] = me.getName(); | |
21 | } | |
22 | } | |
23 | return data; | |
24 | }, | |
25 | ||
26 | getSubmitValue: function() { | |
27 | var me = this; | |
28 | ||
29 | var value = this.processRawValue(this.getRawValue()); | |
30 | if (value !== '') { | |
31 | return value; | |
32 | } | |
33 | ||
34 | return me.skipEmptyText ? null: value; | |
35 | } | |
36 | }); |