exjs之表单提交
addRuleFrom=Ext.create('Ext.form.Panel', {
region:'center', //放置的位置
id:'addRuleForm_br',
bodyPadding: 5,
width: 350,
validateOnchange:false,
// The form will submit an AJAX request to this URL when submitted
url: 'rule/addRule.action', //表单提交的路径
column:2,
// Fields will be arranged vertically, stretched to full width
layout: 'anchor',
defaults: {
anchor: '100%'
//
msgTarget:'title' //设置错误提示信息的样式
},
表单提交成功和Ajax请求成功后需要明确的返回{success:true}
// The fields
defaultType: 'textfield',
items: [{
fieldLabel: 'unitId',
name: 'unitId', //后台可用request.getParmas方法获取参数
id:'unitId_Add',
hidden:true, //设置为true表示隐藏
allowBlank: true //是否为不为必填
},{
fieldLabel: '规则编号',
name: 'code', //后台可用request.getParmas方法获取参数