标签:style blog http color java strong io 数据
凡事都怕但是!Easy-UI的Datagrid没有直接添加link的属性。查看Easy-UI的帮助文档,看到一个formater:格式化函数,可以对某一行进行格式化,然后通过URL+ID的方式把页面跳转到新页面.
3、脚本函数&前台代码
<script type="text/javascript">
//查看详情
function rowformater(value, row, index) {
return "<a href='NewsDetial.aspx?NoticeID=" + row.ID + "' target='_block'>" + row.Title + "</a>";
}
</script><table id="dg" title="已发布消息" class="easyui-datagrid" style="width: 1090px; height: 430px; padding-left: 200px;" data-options="rownumbers:true,url:'EasyUITotalNews.ashx/ProcessRequest',pageSize:5,pageList:[5,10,15,20],method:'get',toolbar:'#tb' ," toolbar="#toolbar" pagination="true" rownumbers="true" fitcolumns="true" striped="true" singleselect="true">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'ID',width:150,align:'center'">消息编号</th>
<th data-options="field:'Title',width:150,align:'center',formatter: rowformater">消息名称</th>
<th data-options="field:'PublishDepart',width:150,align:'center'">发送单位</th>
<th data-options="field:'ReceiveDepart',width:150,align:'center'">接收单位</th>
<th data-options="field:'PublishTime',width:150,align:'center'">发送时间</th>
<th data-options="field:'NoticeState',width:80,align:'center'">是否读取</th>
</tr>
</thead>
</table>
由于Easy-UI本身就是Jquery封装的库,所以其本质还是javascript.虽然本身没有link属性,但是通过其定义的属性或是方法,按照其格式构造一个javascript函数语句即可。
给Jquery easyui 的datagrid 每行增加操作链接,布布扣,bubuko.com
给Jquery easyui 的datagrid 每行增加操作链接
标签:style blog http color java strong io 数据
原文地址:http://blog.csdn.net/zhangleilei4869/article/details/38313489