原創|使用教程|編輯:龔雪|2016-02-16 09:08:31.000|閱讀 700 次
概述:數據網格內置一個很好特性的分頁功能,自定義也相當簡單。在本教程中,我們將創建一個數據網格,并在分頁工具欄上添加一些自定義按鈕。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Kendo UI for jQuery——創建現代Web應用程序的最完整UI庫!查看詳情>>>
數據網格內置一個很好特性的分頁功能,自定義也相當簡單。在本教程中,我們將創建一個數據網格,并在分頁工具欄上添加一些自定義按鈕。
<table id="tt" title="Load Data" class="easyui-datagrid" style="width:550px;height:250px" url="data/datagrid_data.json" iconCls="icon-save" pagination="true"> <thead> <tr> <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>
請注意設置 'pagination' 屬性為true,這樣才會生成分頁工具欄。
var pager = $('#tt').datagrid('getPager'); // get the pager of datagrid pager.pagination({ showPageList:false, buttons:[{ iconCls:'icon-search', handler:function(){ alert('search'); } },{ iconCls:'icon-add', handler:function(){ alert('add'); } },{ iconCls:'icon-edit', handler:function(){ alert('edit'); } }], onBeforeRefresh:function(){ alert('before refresh'); return true; } });
正如您所看到的,我們首先得到數據網格的pager對象,然后重新創建分頁。我們隱藏頁面列表,并添加三個新的按鈕。
下載EasyUI示例:
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網