jQuery EasyUI - Add link to datagrid cell
2024-10-10 21:47:20
Extracted from: http://stackoverflow.com/questions/16061894/jquery-easyui-add-link-to-cell
HTML:
<table id="dgContactSearch" title="Benutzer Suche" class="easyui-datagrid" style="height:160px"
url="getContacts.php"
toolbar="#toolbarContactSearch" pagination="true"
rownumbers="true" fitColumns="true" singleSelect="true">
<thead>
<tr>
<th data-options="field:'firma',width:80,align:'left',formatter:formatCustomerId">Kunde</th>
<th data-options="field:'name',width:50,align:'left',formatter:formatContactUrl">Name</th>
<th field="function" width="50">Funktion</th>
<th field="phone" width="50">Phone</th>
<th field="email" width="50">Email</th>
<th field="mobile" width="50">Mobile</th>
<th field="fax" width="50">Fax</th> <th field="comment" width="120">Kommentare</th>
</tr>
</thead>
</table>
Javascript:
<script>
function formatCustomerId(val,row){
var url = "customerView.php?id=";
return '<a href="'+url + row.customer_id+'">'+val+'</a>';
} function formatContactUrl(val,row){
var url = "contactView.php?id=";
return '<a href="'+url + row.id+'">'+val+'</a>';
}
</script>
REF:
http://blog.csdn.net/com360/article/details/6537074
http://www.jeasyui.com/documentation/datagrid.php
http://jeasyui.com/demo/main/index.php?plugin=DataGrid
http://www.thinkphp.cn/code/207.html
最新文章
- RaphaelJS实践--猫和老鼠矢量图展示
- FindBugs使用
- 【现代程序设计】homework-06
- Android Studio使用中的小常识
- Android IOS WebRTC 音视频开发总结(二四)-- p2p调用堆栈
- [原创]Devexpress XtraReports 系列 7 创建Drill-Down(向下钻取)报表
- python--class test
- GM8180启动过程调试
- spring-oauth-server实践:客户端和服务端环境搭建
- pclConfig.cmake or PCLConfig.cmake
- HashMap内部结构及实现原理
- thymeleaf-在font标签中的使用
- Python 生产者与消费者模型
- delphi XML简单处理
- Which path should be used jdk or jre for JAVA_HOME environment variable?
- pandas2
- 【JS】怎样同一时候处理多个window.onload事件
- 题解 P2472 【[SCOI2007]蜥蜴】
- Codeforces Round #489 (Div. 2) E - Nastya and King-Shamans
- CentOS下SVN使用