直接上代码:
<table id="compileInfoList" style="width:auto;height:725px" url="ManageCompileInfo_findCompileInfoByPage.action" title="XXXX" toolbar="#tb"
singleSelect="true" pagination="true" rownumbers="true" pageList="[20,50,100]" pageSize="20" remoteSort="false" autoRowHeight="false"
data-options="onLoadSuccess:function(data){
if (data.rows.length == 0) {
var body = $(this).data().datagrid.dc.body2;
var width = body.width();
body.find('table tbody').append('<tr><td width = \''+width+'\' style=\' height: 25px; text-align: center;\' colspan=\'6\'>没有对应的数据</td></tr>');
} else {
for (var i = 0; i < data.rows.length; i++) {
var url = 'ManageOrSwPlan_queryOrSwPlanCurrentHandler.action?id=' + data.rows[i].orSwPlanId;
var returnValue = '1';
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
async:false,
success: function(data){
returnValue = data.currentHandler;
$('#compileInfoList').datagrid('updateRow',{
index: i,
row: {
currentHandler: returnValue,
}
});
}
});
}
}
},
onDblClickRow:function(rowIndex,rowData){
editCompileInfo();
}">