/*
* 添加工作任务的容器
*/
var Taskwork = new Ext.Window({
title: "添加工作任务",
autoHight : true,
width: 250,
height: 300,
closeAction: 'hide',
modal : true,
items : addTaskword // 这里面放你的表单。
});
/*
* 给window 附加formpanel
*/
var addTaskword = new Ext.form.FormPanel({
baseCls : 'x-plain',
// url : 'AddWorkTask.aspx',
//params:{task_no:task_no},
defaultType : 'textfield',
labelAlign : 'right',
labelWidth : 60,
style : {
padding : 5
},
frame : true,
items : [{
id: "task_no",
name : "task_no",
fieldLabel : "任务编号",
allowBlank : false
//不允许为空
}, {
id : "task_person",
name : "task_person",
fieldLabel : "任 务 人",
allowBlank : false
},{
id : "task_name",
name : "task_name",
fieldLabel : "任务名称",
allowBlank : false
//不允许为空
},start_date,end_date,
{
id:"task_re",
x:0,
y: 100,
emptyText:'细节描述',
fieldLabel: "细节描述",
name : "task_re",
xtype: 'textarea',
width : 130
}
],
buttonAlign:'center',
buttons : [{
text : '提交',
handler :submitForm },{
text : '清空',
handler : function() {
addTaskword.getForm().reset();
}
}
]
}); /*
* 提交表单
*/
function submitForm(){
addTaskword.getForm().submit({
clientValidation:true,//进行客户端验证
waitMsg : '正在提交数据请稍后',//提示信息
waitTitle : '提示',//标题
url : 'AddWorkTask.aspx',//请求的url地址
method:'POST',//请求方式
success:function(){//加载成功的处理函数
Taskwork.hide();
//updateBookList(action.result.bookId);
Ext.Msg.alert('提示','新增书籍成功');
},
failure:function(){//加载失败的处理函数
Ext.Msg.alert('提示','新增书籍失败');
}
});
}
在IE的调试工具里面 老是出现 ext-all.js 的 return eval("("+json+")" 语法错误。我提交的时候没有转换成json啊?大侠们,第一次使用ext,帮我看看!
楼主说的那个错误 是Ext中有一个Ext.JSON...这么一个封装的方法 就是把后台字符串转为前台json的
但我想不出来 你提交表单和它的json有什么关系