dwr返回函数不执行,怎么解决
用dwr执行插入,返回函数不执行。点击会执行了插入,就是不调用返回函数,代码如下
function insertWorkPlan(obj){
if(button_onsubmit()){
var trobj=j$(obj).parent().parent();
var programName=j$(trobj).find("select[name=programName]").val();
var workTime=j$(trobj).find(":input[name=workTime]").val();
var workBreak=j$(trobj).find(":input[name=workBreak]").val();
var workDiscretion=j$(trobj).find(":input[name=workDiscretion]").val();
var finishDate=j$(trobj).find(":input[name=finishDate]").val();
var finishStatue=j$(trobj).find("select[name=finishStatue]").val();
var headPepole=j$(trobj).find(":input[name=headPepole]").val();
var remark=j$(trobj).find(":input[name=remark]").val();
var coordinationObject=j$(trobj).find(":input[name=coordinationObject]").val();
var superviseTime=j$(trobj).find(":input[name=superviseTime]").val();
var taskType=j$(trobj).find("select[name=taskType]").val();
var myworkplan =programName+","+workTime+","+workBreak+","+workDiscretion+","+finishDate+","
+finishStatue+","+headPepole+","+remark+","+coordinationObject+","+superviseTime+","+taskType;
//DWREngine.setAsync(false);
WorkPlanProxy.insertWorkPlan(myworkplan,function(data){workBack(data,obj,myworkplan);});
//DWREngine.setAsync(true);
}
}
function workBack(data,obj,myworkplan){
alert(data+"===");
var trobj=j$(obj).parent().parent();
var datas=myworkplan.spilt(",");
j$(trobj).empty();
j$(trobj).html(
'<td>'+datas[0]+'</td><td>'+datas[1]+'</td><td>'+datas[2]+'</td><td>'+
datas[3]+'</td><td>'+datas[4]+'</td><td>'+datas[5]+'</td><td>'+datas[6]+'</td>'+
'<td>'+datas[7]+'</td><td>'+datas[8]+'</td><td>'+datas[9]+'</td><td>'+datas[10]+'</td>'+
'<td>'+ '<a href="#" onclick="updateWorkPlan(this)">修改</a> <a href="#" onclick="deleteWorkPlan(this)">删除</a>'+
'</td>'
);
}
这个应该是dwr的BUG吧
楼主可以试试 有问题再贴出来大家一起学习