easui datagrid 行获取后台sql所有数据:支持行chockbox多选,输出选中行任意属性;支持点击表中属性实现跳转;支持分页。...

easyUI datagrid 代码:

<table id="tabgrid20170726191838251403" class="easyui-datagrid" params="fit:true,border:false,selectOnCheck:true,remoteSort:false,
    url:'http://localhost:8090/gzdbthreeweb/engine/loadQueryData.pt?_queryid=20170726191838251403&dataid=20170726191919776397&gridtype=1',
    rownumbers:true,pagination:true,pageNumber:1,pageSize:10,checkOnSelect:true,checkOnSelect:true,onClickRow:onClickRow20170726191838251403,
    toolbar:'#tb20170726191838251403'">
        <thead>
            <tr>
            <th params="field:'_checkid',checkbox:true" rowspan="1"></th>
                <th rowspan="1" colspan="1" params="align:'left',field:'report_task',sortable:true" width="442px">具体任务</th>
                <th rowspan="1" colspan="1" params="align:'left',field:'main_dept_name',sortable:true" width="347px">主办单位</th>
                <th rowspan="1" colspan="1" params="align:'left',field:'assist_dept_name',sortable:true" width="332px">协办单位</th>
            </tr>
        </thead>
</table>

<a href="#" class="zxui-linkbutton" plain="true" id="button495769" iconCls="null" onclick="onClickbutton495769();" >结束上报</a>

获取选中行的id,并拼接弹出:

function onClickbutton495769(){
	var rows = $('#tabgrid20170726191838251403').datagrid('getSelections');
	if(rows != null){
		var ids = "";
		for(var i=0;i<rows.length;i++){
			ids+= rows[i].id+",";
		}
		alert(ids);
	}
}

点击具体任务实现跳转:

function onClickRow20170726191838251403(rowindex, rowdata){
	var row = $('#tabgrid20170726191838251403').datagrid('getSelected'); 
	if(row != null){ 
		var report_id = row.id; alert(report_id); 
		window.location.href="http://localhost:8090/gzdbthreeweb/engine/page_init.pt?_queryid=20170726205804017541&report_id="+report_id; 
	}
}

 

转载于:https://www.cnblogs.com/ckxlovejava/p/7249668.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值