Ext formPanel 按钮作用域问题 ext表单functionjavascriptajax 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 上面漏贴了一部分{ id: 'card-1', layout:'form', title:'周一课程录入', url:'courseIn', name:'form', /* layout: 'hbox',*/ /*method:' Monday',*///传入后台可以每周建立一个方法判断录入 method:'POST', renderTo: Ext.getBody(), width:20, bodyPadding: 1, items: /*[ //上午第一大节课录入 { filedLabel:'上午第一大节', title: '上午第一大节', layout: 'hbox', bodyPadding: 5, height: 80, // 指定高度 items: [ { fieldLabel: '起始周', xtype: 'numberfield', name:'AM1start', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'AM1end', maxValue:20, minValue:1 }, { fieldLabel: '起始周', xtype: 'numberfield', name:'AM1start2', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'AM2end2', maxValue:20, minValue:1 } ], flex: 4, resizable: { handles: 'n s ns', minWidth: 200, minHeight: 80, maxWidth: 500, maxHeight: 400, transparent:false, pinned: true } }, // 上午第二大节课录入 { title: '上午第二大节', layout: 'hbox', bodyPadding: 5, height: 80, // 指定高度 items: [ { fieldLabel: '起始周', xtype: 'numberfield', name:'AM2start', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'AM2end', maxValue:20, minValue:1 }, { fieldLabel: '起始周', xtype: 'numberfield', name:'AM2start2', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'AM2end2', maxValue:20, minValue:1 } ], flex: 4, resizable: { handles: 'n s ns', minWidth: 200, minHeight: 80, maxWidth: 500, maxHeight: 400, transparent:false, pinned: true } }, //下午第一大节课 { title: '下午第一大节', layout: 'hbox', bodyPadding: 5, height: 80, // 指定高度 items: [ { fieldLabel: '起始周', xtype: 'numberfield', name:'PM1start', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'PM1end', maxValue:20, minValue:1 }, { fieldLabel: '起始周', xtype: 'numberfield', name:'PM1start2', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'PM1end2', maxValue:20, minValue:1 } ], flex: 4, resizable: { handles: 'n s ns', minWidth: 200, minHeight: 80, maxWidth: 500, maxHeight: 400, transparent:false, pinned: true } }, //下午第二大节课录入 { title: '下午第二大节', layout: 'hbox', bodyPadding: 5, height: 80, // 指定高度 items: [ { fieldLabel: '起始周', xtype: 'numberfield', name:'PM2start', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'PM2end', maxValue:20, minValue:1 }, { fieldLabel: '起始周', xtype: 'numberfield', name:'PM2start2', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'PM2end2', maxValue:20, minValue:1 } ], flex: 4, resizable: { handles: 'n s ns', minWidth: 200, minHeight: 80, maxWidth: 500, maxHeight: 400, transparent:false, pinned: true } } ]*/ [ { layout:'form', xtype:'fieldset', title:'上午第一大节', aotuHeight:true, /*defaultType:'numberfield',*/ items:[ {layout:'column',//对每一个fieldset进行列排列 items:[ { fieldLabel: '起始周', xtype: 'numberfield', name:'AM1start', maxValue:20, minValue:1 }, { fieldLabel: '结束周', xtype: 'numberfield', name:'AM1end', maxValue:20, minValue:1 },{ fieldLabel: '起始周', xtype: 'numberfield', name:'AM1start2', maxValue:20, minValue:1 },{ fieldLabel: '结束周', xtype: 'numberfield', name:'AM2end2', maxValue:20, minValue:1 }] } ] }, {},{},{}] ,buttons: [ { // 重设按钮 text: '重设', // 单击该按钮时重设表单 handler: function() { this.up('form').getForm().reset(); /* Ext.Msg.alert("按钮","巴塞罗那球迷"); */ } }, { // 提交按钮 text: '提交', formBind: true, // 只有当整个表单输入校验通过时,该按钮才可用 disabled: true, // 设置该按钮默认不可用 // 单击该按钮的事件处理函数 handler: function() { // 获取表单,实际返回的是Ext.form.Basic对象 var form = this.up('form').getForm(); // 如果表单输入校验通过 if (form.isValid()) { // 以Ajax方式提交表单 form.submit( { // 提交成功,第一个参数是Ext.form.Basic对象 // 第二个参数是Ext.action.Action对象 success: function(form, action) { Ext.Msg.alert('提交成功!', action.result.msg); }, // 提交失败 failure: function(form, action) { Ext.Msg.alert('提交失败!', action.result.msg); } }); } } } ] }这是完整的 效果图如下: js接受串口无法接受串口数据,什么原因? 请问:js中这是什么现象??? 急,急 菜单显示问题CSS+JS 解决了多给分! input的name属性带有括号,JS如何获取该对象? 求一正则表达式的意思 <map>area cursor 可以设置的吗 发布一基于ajax的BLOG系统供下载,请大家去踩踩 给100分继续研究JavaScript正则 请问在弹alert出窗口中怎么样换行 jquery插件的使用,请牛人看看 帮我找错 (功能 点击连接后 别的连接消失 【在线求指教】javascript 函数加载疑问
id: 'card-1',
layout:'form',
title:'周一课程录入',
url:'courseIn',
name:'form',
/* layout: 'hbox',*/
/*method:' Monday',*///传入后台可以每周建立一个方法判断录入
method:'POST',
renderTo: Ext.getBody(),
width:20,
bodyPadding: 1,
items: /*[
//上午第一大节课录入
{
filedLabel:'上午第一大节',
title: '上午第一大节',
layout: 'hbox',
bodyPadding: 5,
height: 80, // 指定高度
items: [
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'AM1start',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'AM1end',
maxValue:20,
minValue:1
},
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'AM1start2',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'AM2end2',
maxValue:20,
minValue:1
}
],
flex: 4,
resizable: {
handles: 'n s ns',
minWidth: 200,
minHeight: 80,
maxWidth: 500,
maxHeight: 400,
transparent:false,
pinned: true
}
},
// 上午第二大节课录入
{
title: '上午第二大节',
layout: 'hbox',
bodyPadding: 5,
height: 80, // 指定高度
items: [
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'AM2start',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'AM2end',
maxValue:20,
minValue:1
},
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'AM2start2',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'AM2end2',
maxValue:20,
minValue:1
}
],
flex: 4,
resizable: {
handles: 'n s ns',
minWidth: 200,
minHeight: 80,
maxWidth: 500,
maxHeight: 400,
transparent:false,
pinned: true
}
},
//下午第一大节课
{
title: '下午第一大节',
layout: 'hbox',
bodyPadding: 5,
height: 80, // 指定高度
items: [
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'PM1start',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'PM1end',
maxValue:20,
minValue:1
},
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'PM1start2',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'PM1end2',
maxValue:20,
minValue:1
}
],
flex: 4,
resizable: {
handles: 'n s ns',
minWidth: 200,
minHeight: 80,
maxWidth: 500,
maxHeight: 400,
transparent:false,
pinned: true
}
},
//下午第二大节课录入
{
title: '下午第二大节',
layout: 'hbox',
bodyPadding: 5,
height: 80, // 指定高度
items: [
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'PM2start',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'PM2end',
maxValue:20,
minValue:1
},
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'PM2start2',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'PM2end2',
maxValue:20,
minValue:1
}
],
flex: 4,
resizable: {
handles: 'n s ns',
minWidth: 200,
minHeight: 80,
maxWidth: 500,
maxHeight: 400,
transparent:false,
pinned: true
}
}
]*/
[
{
layout:'form',
xtype:'fieldset',
title:'上午第一大节',
aotuHeight:true,
/*defaultType:'numberfield',*/
items:[
{layout:'column',//对每一个fieldset进行列排列
items:[
{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'AM1start',
maxValue:20,
minValue:1
},
{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'AM1end',
maxValue:20,
minValue:1
},{
fieldLabel: '起始周',
xtype: 'numberfield',
name:'AM1start2',
maxValue:20,
minValue:1
},{
fieldLabel: '结束周',
xtype: 'numberfield',
name:'AM2end2',
maxValue:20,
minValue:1
}]
}
]
},
{},{},{}]
,buttons: [
{
// 重设按钮
text: '重设',
// 单击该按钮时重设表单
handler: function()
{
this.up('form').getForm().reset();
/* Ext.Msg.alert("按钮","巴塞罗那球迷"); */
}
},
{
// 提交按钮
text: '提交',
formBind: true, // 只有当整个表单输入校验通过时,该按钮才可用
disabled: true, // 设置该按钮默认不可用
// 单击该按钮的事件处理函数
handler: function()
{
// 获取表单,实际返回的是Ext.form.Basic对象
var form = this.up('form').getForm();
// 如果表单输入校验通过
if (form.isValid())
{
// 以Ajax方式提交表单
form.submit(
{
// 提交成功,第一个参数是Ext.form.Basic对象
// 第二个参数是Ext.action.Action对象
success: function(form, action)
{
Ext.Msg.alert('提交成功!', action.result.msg);
},
// 提交失败
failure: function(form, action)
{
Ext.Msg.alert('提交失败!', action.result.msg);
}
});
}
}
}
]
}这是完整的 效果图如下: