ext提交,很简单的问题,哪位耐心人士帮帮看看

shuaiyz 2010-11-18 12:06:40
//添加用户的窗口
function toadd() {
var addwin = new Ext.Window( {
width : 500,
height : 300,
title : '添加信息',
collapsible : true,
plain : true,
modal : true
});
//添加用户的表单
var addform = new Ext.form.FormPanel( {
layout : 'form',
id : 'add_form',
buttonAlign : 'center',
labelAlign : 'right',
region : 'center',
defaultType : 'textfield',
items : [ {
name : 'terminal_id',
fieldLabel : '终端编号',
width : 180,
allowBlank : false,
blankText : '终端编号不能为空' //错误信息提示
}, {
name : 'terminal_type',
fieldLabel : '终端类型',
width : 180,
allowBlank : false,
blankText : '终端类型不能为空'
}, {
name : 'is_controllable',
id : 'is_controllable',
fieldLabel : '是否可控制',
xtype : 'combo',
triggerAction : 'all',
store : [ [ '1', '是' ], [ '0', '否' ] ],
width : 80,
editable : false,
emptyText : '请选择'
}, {
name : 'is_shuttable',
id : 'is_shuttable',
fieldLabel : '是否可跳闸',
xtype : 'combo',
triggerAction : 'all',
store : [ [ '1', '是' ], [ '0', '否' ] ],
width : 80,
editable : false,
emptyText : '请选择'
}, {
name : 'is_readdable',
id : 'is_readdable',
fieldLabel : '是否可读表',
xtype : 'combo',
triggerAction : 'all',
store : [ [ '1', '是' ], [ '0', '否' ] ],
width : 80,
editable : false,
emptyText : '请选择'
}, {
name : 'charge_person',
fieldLabel : '负责人',
width : 180,
allowBlank : false,
blankText : '负责人不能为空'
}, {
name : 'active_time',
fieldLabel : '投运日期',
width : 140,
xtype : 'datefield',
format : 'Y-m-d'
}, {
name : 'is_active',
id : 'is_active',
fieldLabel : '是否有效',
xtype : 'combo',
triggerAction : 'all',
store : [ [ '1', '是' ], [ '0', '否' ] ],
width : 80,
editable : false,
emptyText : '请选择'
} ],
buttons : [ {
text : '确定',
type : 'submit',
handler : function() {
if (addform.form.isValid()) {
addform.form.doAction('submit', {
url : 'donew.do',
method : 'POST',
success : function(form, action) {
addwin.hide();
Ext.Msg.alert('系统信息',
action.result.data);
ds.reload();
},
failure : function(form, action) {
Ext.Msg.alert('系统信息',
action.resultldata);
ds.reload();
addwin.hide();
}
});
}
}
} ]
});
addwin.add( {
items : addform
});

addwin.show();
}
问题:点提交的时候ie浏览器报语法错误,请哪位高手帮忙看看是哪里错了
...全文
161 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2010-11-18
  • 打赏
  • 举报
回复
failure 中 action.resultldata => action.result.data
asdujiayong 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 shuaiyz 的回复:]

引用 8 楼 leehuat 的回复:
CSS code

name : 'is_readdable',
id : 'is_readdable',
fieldLabel : '是否可读表',
mode: 'local',//设置model
xtype : 'combo',
triggerAction : 'all',
store: new Ext.data.ArrayStore……
[/Quote]
加个属性hiddenName
shuaiyz 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 leehuat 的回复:]
CSS code

name : 'is_readdable',
id : 'is_readdable',
fieldLabel : '是否可读表',
mode: 'local',//设置model
xtype : 'combo',
triggerAction : 'all',
store: new Ext.data.ArrayStore({
fields: [……
[/Quote]
为什么我像你这样设置了传到后台的还是 ‘是’而不是0呢
shuaiyz 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 asdujiayong 的回复:]
ds.reload();注掉先看看.
[/Quote]
注掉也不行啊,信息添加上了,可是点提交的时候没反应,提示语法错误
leehuat 2010-11-18
  • 打赏
  • 举报
回复

name : 'is_readdable',
id : 'is_readdable',
fieldLabel : '是否可读表',
mode: 'local',//设置model
xtype : 'combo',
triggerAction : 'all',
store: new Ext.data.ArrayStore({
fields: [
'myId',
'displayText'
],
data: [[0, '是'], [1, '否']]
}),
valueField: 'myId',
displayField: 'displayText'
width : 80,
editable : false,
emptyText : '请选择'

lfkcn 2010-11-18
  • 打赏
  • 举报
回复
你这代码这样看太费事了,找个好点的IDE,看看那些(),{},逗号啥的是不是有多的有少的,一般情况下都是这些造成的
asdujiayong 2010-11-18
  • 打赏
  • 举报
回复
ds.reload();注掉先看看.
shuaiyz 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lfkcn 的回复:]
啥语法错误,贴上来看看
[/Quote]
就是浏览器左下角一个黄叹号,点开提示语法错误
shuaiyz 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lfkcn 的回复:]
啥语法错误,贴上来看看
[/Quote]
lfkcn 2010-11-18
  • 打赏
  • 举报
回复
啥语法错误,贴上来看看
shuaiyz 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hookee 的回复:]
failure 中 action.resultldata => action.result.data
[/Quote]
这个排除在外,我改了还是说语法错误,还有别的什么问题吗

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧