jQuery EasyUI - Add link to datagrid cell

Extracted from: http://*.com/questions/16061894/jquery-easyui-add-link-to-cell

HTML:

jQuery EasyUI - Add link to datagrid cell
 1 <table id="dgContactSearch" title="Benutzer Suche" class="easyui-datagrid" style="height:160px" 
 2                             url="getContacts.php"
 3                             toolbar="#toolbarContactSearch" pagination="true"
 4                             rownumbers="true" fitColumns="true" singleSelect="true">
 5                         <thead>
 6                             <tr>
 7                                 <th data-options="field:‘firma‘,width:80,align:‘left‘,formatter:formatCustomerId">Kunde</th>
 8                                 <th data-options="field:‘name‘,width:50,align:‘left‘,formatter:formatContactUrl">Name</th>
 9                                 <th field="function" width="50">Funktion</th>
10                                 <th field="phone" width="50">Phone</th>
11                                 <th field="email" width="50">Email</th>
12                                 <th field="mobile" width="50">Mobile</th>
13                                 <th field="fax" width="50">Fax</th>
14 
15                                 <th field="comment" width="120">Kommentare</th>
16                             </tr>
17                         </thead>
18 </table>
jQuery EasyUI - Add link to datagrid cell
 

 Javascript:

jQuery EasyUI - Add link to datagrid cell
 1 <script>
 2 function formatCustomerId(val,row){
 3     var url = "customerView.php?id=";
 4     return ‘<a href="‘+url + row.customer_id+‘">‘+val+‘</a>‘;
 5 }
 6 
 7 function formatContactUrl(val,row){
 8     var url = "contactView.php?id=";
 9     return ‘<a href="‘+url + row.id+‘">‘+val+‘</a>‘;
10 }
11 </script>
jQuery EasyUI - Add link to datagrid cell

 

 

 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

jQuery EasyUI - Add link to datagrid cell

上一篇:Silverlight WCF "尝试向 URI发出请求时出错。这可能是由于试图以跨域方式访问服务而又没有正确的跨域策略" 错误的解决方法


下一篇:配置openSuSE 13.1自带的Apache+php