]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - panel/InputPanel.js
1 Ext
.define('Proxmox.panel.InputPanel', {
2 extend
: 'Ext.panel.Panel',
3 alias
: ['widget.inputpanel'],
6 // notify owning container that it should display a help button
8 Ext
.GlobalEvents
.fireEvent('proxmoxShowHelp', this.onlineHelp
);
11 deactivate: function() {
12 if (this.onlineHelp
) {
13 Ext
.GlobalEvents
.fireEvent('proxmoxHideHelp', this.onlineHelp
);
19 // override this with an URL to a relevant chapter of the pve manual
20 // setting this will display a help button in our parent panel
21 onlineHelp
: undefined,
23 // will be set if the inputpanel has advanced items
26 // if the panel has advanced items,
27 // this will determine if they are shown by default
30 // overwrite this to modify submit data
31 onGetValues: function(values
) {
35 getValues: function(dirtyOnly
) {
38 if (Ext
.isFunction(me
.onGetValues
)) {
44 Ext
.Array
.each(me
.query('[isFormField]'), function(field
) {
45 if (!dirtyOnly
|| field
.isDirty()) {
46 Proxmox
.Utils
.assemble_field_data(values
, field
.getSubmitData());
50 return me
.onGetValues(values
);
53 setAdvancedVisible: function(visible
) {
55 var advItems
= me
.getComponent('advancedContainer');
57 advItems
.setVisible(visible
);
61 setValues: function(values
) {
64 var form
= me
.up('form');
66 Ext
.iterate(values
, function(fieldId
, val
) {
67 var field
= me
.query('[isFormField][name=' + fieldId
+ ']')[0];
70 if (form
.trackResetOnLoad
) {
71 field
.resetOriginalValue();
77 initComponent: function() {
92 } else if (me
.column4
) {
128 } else if (me
.column1
) {
141 items
: me
.column2
|| [] // allow empty column
153 throw "unsupported config";
157 if (me
.advancedItems
) {
162 items
: me
.advancedItems
165 me
.advancedItems
= undefined;
166 } else if (me
.advancedColumn1
) {
172 items
: me
.advancedColumn1
178 items
: me
.advancedColumn2
|| [] // allow empty column
182 me
.advancedColumn1
= undefined;
183 me
.advancedColumn2
= undefined;
185 if (me
.advancedColumnB
) {
190 items
: me
.advancedColumnB
192 me
.advancedColumnB
= undefined;
197 me
.hasAdvanced
= true;
210 itemId
: 'advancedContainer',
211 hidden
: !me
.showAdvanced
,
220 if (me
.useFieldContainer
) {
223 items
: Ext
.apply(me
.useFieldContainer
, {
225 defaultType
: 'container',
232 defaultType
: 'container',