]>
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('pveShowHelp', this.onlineHelp
);
11 deactivate: function() {
12 if (this.onlineHelp
) {
13 Ext
.GlobalEvents
.fireEvent('pveHideHelp', 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 // overwrite this to modify submit data
24 onGetValues: function(values
) {
28 getValues: function(dirtyOnly
) {
31 if (Ext
.isFunction(me
.onGetValues
)) {
37 Ext
.Array
.each(me
.query('[isFormField]'), function(field
) {
38 if (!dirtyOnly
|| field
.isDirty()) {
39 Proxmox
.Utils
.assemble_field_data(values
, field
.getSubmitData());
43 return me
.onGetValues(values
);
46 setValues: function(values
) {
49 var form
= me
.up('form');
51 Ext
.iterate(values
, function(fieldId
, val
) {
52 var field
= me
.query('[isFormField][name=' + fieldId
+ ']')[0];
55 if (form
.trackResetOnLoad
) {
56 field
.resetOriginalValue();
62 initComponent: function() {
77 } else if (me
.column4
) {
113 } else if (me
.column1
) {
126 items
: me
.column2
|| [] // allow empty column
138 throw "unsupported config";
141 if (me
.useFieldContainer
) {
144 items
: Ext
.apply(me
.useFieldContainer
, {
146 defaultType
: 'container',
153 defaultType
: 'container',