Easyui Datagrid每行增加超链接

来源:互联网 发布:js实现div拖动效果 编辑:程序博客网 时间:2024/04/27 02:15

Easyui Datagrid 的增删及超链接的增加在网上随处可见,我的项目中也用到挺多,记一下

利用Easyui框架为每行添加超链接:


这里用到的是easyui自带的formatter属性

<thead>            <tr>                <th data-options="field:'ck',width:50,checkbox:true,align:'center'"></th>                <th data-options="field:'CName',width:120,align:'center',sortable:true,Filter:true">姓名</th>                <th data-options="field:'CID',width:250,align:'center',sortable:true">身份证号</th>                <th data-options="field:'Tel',width:150,align:'center',sortable:true">电话</th>                <th data-options="field:'SDate',width:120,align:'center',sortable:true">申请时间</th>                 <th data-options="field:'SState',width:120,align:'center',Filter:true">办结状态</th>                 <th data-options="field:'Title',width:100,align:'center',formatter:rowformater">处理</th>             </tr>        </thead>

<script type="text/javascript">        function rowformater(value, row, index) {            return "<a href='LoanApplyHandle.aspx?NoticeID=" + row.CMLoanApplyID + "' target='_self'>" + "处理" + "</a>";//_top,        }    </script>

其中,formatter属性的介绍可参见http://www.jeasyui.net/plugins/183.html

<a>标签的target属性可参见http://www.w3school.com.cn/tags/att_a_target.asp

这样就可以跳转到LoanApplyHandle.aspx页面进行其他操作。


0 0
原创粉丝点击