easyui-datagrid的绑定

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
						});
					 }
			    }
  		});

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值