我有一个当前没有存储的formpanel。我想要达到的目标是通过单击该面板中的按钮将该表单的数据对象存储在变量中。如何实现这一目标?Extjs4变量中的Formpanel数据strore
这里是我的代码:
Ext.define('Nits.view.PropertyPanelCmp', {
extend:'Ext.form.Panel',
alias : 'widget.propertypanelCmp',
id: 'propertypanelCmp',
title: 'File properties',
height: 500,
width: 200,
draggable: false,
closable: false,
//autoScroll:true,
layout: {
align: 'stretch',
type: 'vbox'
},
fieldDefaults: {
labelWidth: 65
},
bodyPadding: 10,
initComponent: function() {
var me = this;
me.items = [
{
xtype: 'fieldset',
height: 108,
title: 'Common Properties',
items: [
{
xtype: 'textfield',
fieldLabel: 'Name',
anchor: '100%'
},
{
xtype: 'textfield',
fieldLabel: 'Type',
anchor: '100%'
},
{
xtype: 'textfield',
fieldLabel: 'Age',
anchor: '100%'
}
]
},
{
xtype: 'fieldset',
title: 'Level1 Properties',
items: [
{
xtype: 'textfield',
fieldLabel: 'Sample1',
anchor: '100%'
},
{
xtype: 'checkboxfield',
fieldLabel: 'Recursive',
// boxLabel: 'Box Label',
anchor: '100%'
},
{
xtype: 'checkboxfield',
fieldLabel: 'Delete',
// boxLabel: 'Box Label',
anchor: '100%'
},
{
xtype: 'checkboxfield',
fieldLabel: 'Read Only',
// boxLabel: 'Box Label',
anchor: '100%'
},
{
xtype: 'textfield',
fieldLabel: 'Include',
anchor: '100%'
},
{
xtype: 'textfield',
fieldLabel: 'Exclude',
anchor: '100%'
}
]
},
{
xtype: 'fieldset',
title: 'Level2 Properties',
items: [
{
xtype: 'combobox',
fieldLabel: 'File B',
anchor: '100%'
}
]
},
{
xtype: 'button',
text: 'Apply',
listeners: {
click: {
fn: me.onButtonClick,
scope: me
}
}
}
];
me.callParent(arguments);
},
//Here do what you want to when click on Apply button
onButtonClick: function(button, e, options) {
alert('Sample');
}
}
);
需要JSON对象,这个表单元素
我接受了所有工作答案 – 2012-07-17 15:45:35
不够公平。只要确定。你会惊讶有多少*不知道。 – Drise 2012-07-17 16:48:14