我有这样的extjs类添加:
Ext.ns('Example');
Example.Form = Ext.extend(Ext.form.FormPanel, {
,initComponent:function() {
// hard coded - cannot be changed from outsid
var config = {
items: [{
xtype: 'textfield',
fieldLabel: 'title',
name: 'author',
allowBlank: false
}
.........................
]
,buttons:[
{
text:'submit'
,formBind:true
,scope:this
,handler:this.submit
}]
}; // eo config object
// apply config
Ext.apply(this, Ext.apply(this.initialConfig, config));
// call parent
Example.Form.superclass.initComponent.apply(this, arguments);
} // eo function initComponent
/**
* Form onRender override
*/
,onRender:function() {
..................
} // eo function onRender
/**
* Reset
*/ …
Run Code Online (Sandbox Code Playgroud) 我有这样的extjs形式:
{
xtype : 'textfield',
fieldLabel : 'name',
name : 'vTitle',
allowBlank : false
},{
xtype : 'datefield',
fieldLabel : 'name',
name : 'date',
allowBlank : false
}
Run Code Online (Sandbox Code Playgroud)
当我提交表单值时,将其发送到服务器,如下所示:
Parameters:
vTitle:mm
date:9/11/2011
Run Code Online (Sandbox Code Playgroud)
提交表单时,我希望发送自己的值而不是默认值。例如,当我提交日期:9/11/2011
我想要日期:my value related with 9/11/2011
发送到服务器。
我在表单中使用了setvalue,但是如果服务器出现错误,我会更改默认表单值并且不希望使用setvalue(仅将自己的值发送到服务器)