html:
<div class="easyui-panel"
id="id_dd_cancle_authorization_index_BankCardDiv"
style="height: 200px; width: 100%;"
data-options="region:'center',border:false,title:'银行卡信息',iconCls:'icon-man'">
<table id="id_dd_cancle_authorization_index_gridData"
style="width: 100%; height: 100%; padding: 0px; margin: 0px;"
class="easyui-datagrid"
data-options="
collapsible: true,
rownumbers: true,
striped:true,
singleSelect:true,
remoteSort:false,
scrollbarSize:25">
<thead>
<tr>
<th data-options="field:'bankDdVendorCode',width:150"><font face="宋体" color="#4682B4"><b>授权渠道</b></font></th>
<th data-options="field:'authExpireDate',width:150"><font face="宋体" color="#4682B4"><b>授权截止日期</b></font></th>
<th data-options="field:'vendorCancel',width:150"><font face="宋体" color="#4682B4"><b>Vendor解约</b></font></th>
<th data-options="field:'homerCancel',width:150"><font face="宋体" color="#4682B4"><b>Homer解约</b></font></th>
</tr>
</thead>
</table>
</div>
JS:
$('#id_repayment_deductWeb_normal_index_queryBatch').datagrid({
'queryParams': batch_param,
'url': website.site.root + '/normal/getJDPayBatchFileList',
'singleSelect': true,
'fitColumns': true,
'fit': true,
'striped':true,
'rownumbers': true,
'remoteSort':false,
'onRowContextMenu': function (e, rowIndex, rowData) {
$('#id_repayment_deductWeb_normal_index_queryBatch').datagrid('selectRow',rowIndex);
$('#id_repayment_deductWeb_normal_index_menu').menu('show', {left: e.pageX, top: e.pageY});
e.preventDefault();
},
'onLoadSuccess':function(data){
func_repayment_deductWeb_normal_index_LoadReportData(data);
},
'onLoadError': function (XMLHttpRequest, textStatus, errorThrown) {
if (textStatus === "error") {
window.location.href = 'http://status_403.html';
}
}
上面这种情况是你直接通过datagrid去访问他的url来绑定数据;下面这种是通过ajax的方式去访问url,通过遍历返回的值进行绑定
JS:
$.ajax({
type: 'post',
url : website.site.root + '/ddCancelAuthorization/getDdAuthInfo',
data : param,
dataType: 'json',
success : function(map)
{
for(var key in map){
var value = map[key];
var authorizations=value.authorizations;
$('#id_dd_cancle_authorization_index_gridData').datagrid({
data: authorizations
});
}
}
});