Dojo EnhancedGrid Pagination

昨天凌晨时间,Dojo的Grid分页插件低调上线,对于使用dojo作为项目前端来说,是个利好消息。悲催的是这个分页插件并不在dojo 1.5 realase中。而在dojo的孵化器系列中http://archive.dojotoolkit.org/nightly。直接上例子。

   js code:   

01<script type="text/javascript">
02dojo.require("dojox.grid.EnhancedGrid");
03dojo.require("dojox.grid.enhanced.plugins.Pagination");
04dojo.require("dojox.data.CsvStore");
05  
06dojo.addOnLoad(function(){
07  // our test data store for this example:
08  var store = new dojox.data.CsvStore({ url: '{{ dataUrl }}dojox/grid/tests/support/movies.csv' });
09  
10  // set the layout structure:
11  var layout = [
12    { field: 'Title', name: 'Title of Movie', width: '200px' },
13    { field: 'Year', name: 'Year', width: '50px' },
14    { field: 'Producer', name: 'Producer', width: 'auto' }
15  ];
16  
17  // create a new grid:
18  var grid = new dojox.grid.EnhancedGrid({
19    store: store,
20    structure: layout,
21    plugins : {
22    }
23  }, document.createElement('div'));
24  
25  // append the new grid to the div "gridContainer4":
26  dojo.byId("gridDiv").appendChild(grid.domNode);
27  
28  // Call startup, in order to render the grid:
29  grid.startup();
30});
31</script>

html code:

1<div id="gridDiv" style="width: 100%; height: 100%;"></div>

css code:

1<style type="text/css">
2@import "{{ baseUrl }}dojo/resources/dojo.css";
3@import "{{ baseUrl }}dijit/themes/{{ theme }}/{{ theme }}.css";
4@import "{{ baseUrl }}dojox/grid/enhanced/resources/{{ theme }}EnhancedGrid.css";
5@import "{{ baseUrl }}dojox/grid/enhanced/resources/EnhancedGrid_rtl.css";
6</style>

dojo这个分页插件的配置参数如下:

效果:

整个分页配置非常简单,现学现卖^_^。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值