- 注册时间
- 2013-6-27
- 最后登录
- 2014-5-29
- 阅读权限
- 10
- 积分
- 236
- 精华
- 0
- 帖子
- 72
|
factory 发表于 2014-5-5 11:07
你把ajax获取数据独立出来,写到监听事件的上面去,代码依次从上往下执行下去的 ...
var project = new Array();
jQuery(function($){
$.ajax({
url: "ha02Action.loadAiistBusinessEvent.action",
data: {},
type: "post",
success: function (text) {
project = text;
},
error: function (jqXHR, textStatus, errorThrown) {
issave=false;//保存结束
window.location.href="<%=request.getContextPath()%>/exception/error.jsp";
//CloseWindow();
}
});
});
grid2.on("drawcell", function (e) {
var record = e.record;
column = e.column;
if(column.name == 'azfx0001'){
var str = '<input type="text" value="" style="display:none;" id="azfx0001'+record.azfx0001+'" name="azfx0001"/>';
for(var i=0;i<project.length;i++){
if(project.azfx0001 == record.azfx0001){
str+='<input type="checkbox" id="azfx0007" onclick="readit('+project.azfx0001+')" name="azfx0007'+project.azfx0001+'" value="'+project.azfx0007+'"/>'+project.azfx0008;
}
}
e.cellHtml = str;
}
}); |
|