easyUI 添加CheckBox选择到DataGrid
生活随笔
收集整理的這篇文章主要介紹了
easyUI 添加CheckBox选择到DataGrid
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
@author YHC
這個教程向你展示如何放置一個checkbox 列到datagrid,這個復(fù)選框用戶將可以選擇 選中/取消選中 datagrid行數(shù)據(jù).
查看 Demo
添加一個checkbox 列我們僅僅需要添加一個列的checkbox 屬性設(shè)置它為true,代碼看上去就像這些:
<table id="tt" title="Checkbox Select" class="easyui-datagrid" style="width:550px;height:250px" url="data/datagrid_data.json" idField="itemid" pagination="true" iconCls="icon-save"> <thead> <tr> <th field="ck" checkbox="true"></th> <th field="itemid" width="80">Item ID</th> <th field="productid" width="80">Product ID</th> <th field="listprice" width="80" align="right">List Price</th> <th field="unitcost" width="80" align="right">Unit Cost</th> <th field="attr1" width="100">Attribute</th> <th field="status" width="60" align="center">Stauts</th> </tr> </thead> </table> 以上代碼我們添加了一個列有一個checkbox 屬性所以它將成為checkbox 列,如果idField 屬性是設(shè)置的,DataGrid 選擇的集合將維護在不同的頁面.
下載EasyUI示例代碼:
easyui-datagrid-demo.zip轉(zhuǎn)載于:https://www.cnblogs.com/javaexam2/archive/2012/08/10/2632643.html
總結(jié)
以上是生活随笔為你收集整理的easyUI 添加CheckBox选择到DataGrid的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 移动端页面不需要在meta加_移动端适配
- 下一篇: 气象ts评分_给大家分享一个格点插值到站