dojo grid 分页
dojo很强大,也很方便,但是缺少文档,只能看源代码,也挺好的,就是费时间。。。
网上找了一段代码(找不到原出处了,不好意思),也看了dojo自带的demo,放一段可以执行的页面代码这里。把ip换成自己架设的js服务器(esi的CDN貌似有点问题)即可
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>dojo grid 分页</title> <link rel="stylesheet" href="http://192.168.30.86/arcgis_js_api/library/3.12/dojo/resources/dojo.css">
<link rel="stylesheet" href="http://192.168.30.86/arcgis_js_api/library/3.12/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://192.168.30.86/arcgis_js_api/library/3.12/dijit/themes/claro/document.css">
<link rel="stylesheet" href="http://192.168.30.86/arcgis_js_api/library/3.12/dojox/grid/enhanced/resources/claro/EnhancedGrid.css">
<link rel="stylesheet" href="http://192.168.30.86/arcgis_js_api/library/3.12/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css"> <style>
#gridDiv{
width: 60em;
height: 35em;
border: 1px solid #D5CDB5;
}
</style>
<script src="http://192.168.30.86/arcgis_js_api/library/3.12/init.js"></script>
<script> require([
"dojo/parser",
"dojox/grid/EnhancedGrid", //表格
"dojo/data/ItemFileWriteStore",//数据
"dojox/grid/enhanced/plugins/DnD", //拖拽
"dojox/grid/enhanced/plugins/Pagination",//分页
"dojox/grid/enhanced/plugins/nestedSorting",//嵌套排序
"dijit/form/Button","dojo/dom","dojo/on","esri/config","esri/lang","dojo/domReady!"
],
function () {
//获取数据
var data = {
identifier : 'id',
items : []
};
var data_list = [{
col1 : "normal",
col2 : false,
col3 : 'But are not followed by two hexadecimal',
col4 : 29.91
}, {
col1 : "important",
col2 : false,
col3 : 'Because a % sign always indicates',
col4 : 9.33
}, {
col1 : "important",
col2 : false,
col3 : 'Signs can be selectively',
col4 : 19.34
}
];
var rows = 60;
for (var i = 0, l = data_list.length; i < rows; i++) {
data.items.push(dojo.mixin({
id : i + 1
}, data_list[i % l]));
}
var store = new dojo.data.ItemFileWriteStore({
data : data
}); dojo.ready(function () {
/*set up layout*/
var layout = [[{
name : 'slector',
field : 'Sel',
editable : true,
width : '20px',
cellStyles : 'text-decoration: none; cursor:default; text-align: center;position: relative; left: -10px',
headerStyles : 'text-align: center;',
type : dojox.grid.cells.Bool//选择器
}, {
'name' : 'Column 1',
'field' : 'id'
}, {
'name' : 'Column 2',
'field' : 'col2'
}, {
'name' : 'Column 3',
'field' : 'col3',
'width' : '230px'
}, {
'name' : 'Column 4',
'field' : 'col4',
'width' : '230px'
}
]];
/*create a new grid:*/
var grid = new dojox.grid.EnhancedGrid({
id : 'grid',
store : store,
structure : layout,
plugins : {
nestedSorting:true,//嵌套排序
dnd : false,//数据拖拽
pagination : {//分页
pageSizes :[ "10", "20", "50","100", "ALL"],//最后一个只是标识,不显示的
//[10, 20, 50, Infinity],//或者换这种写法
//description: true,//描述,第1-20个,共60个。默认是true
//sizeSwitch: true,//分页大小切换,默认是true
maxPageStep : 8,
gotoButton : true,//转至第几页,默认为false
defaultPage : 1,
defaultPageSize : 20,
position: "bottom"//有三种方式,top, bottom, both,默认是bottom
},
},
rowSelector : '20px'
},
document.createElement('div'));
/*append the new grid to the div*/
dojo.byId("gridDiv").appendChild(grid.domNode);
/*Call startup() to render the grid*/
grid.startup();
}); });
</script>
</head>
<body class="claro">
<div id="gridDiv">
</div>
</body>
</html>
gird分页
效果如下图

其他的再说吧
dojo grid 分页的更多相关文章
- dojo grid 编辑问题
今天dojo grid编辑小问题,找了半天才找到问题, 1.问题 2.原因 数据单元没有索引列->id 3.修改前代码 <!DOCTYPE HTML> <html lang=& ...
- dojo表格分页插件报错
dojo表格分页插件报错 (1)dojo/parser::parse() error ReferenceError {stack:(...),message:"layout is not d ...
- dojo表格分页之各个参数代表的意义(一)
下面是dojo表格分页参数代表的意义 //每页可以显示10/15/20/25/30条记录 (1)pageSizes: [10, 15, 20, 25,30], //每页显示的记录从多少到多少,共多少条 ...
- [转]ExtJS Grid 分页时保持选中的简单实现方法
原文地址 :http://www.qeefee.com/article/ext-grid-keep-paging-selection ExtJS中经常要用到分页和选择,但是当选择遇到分页的时候,杯具就 ...
- ExtJS自制表格Grid分页条
试过Grid自带的load和分页功能,没有成功,干脆就自己写了...... 主要是查询条件比较复杂...... 希望哪位大神能有更好的意见. Ext.define('MyApp.ux.Paginati ...
- ExtJS入门教程06,grid分页的实现
前面两篇内容分别介绍了extjs grid的基本用法和extjs grid异步加载数据,这篇文章将介绍extjs grid的分页. 数据量大的时候我们必须用到分页,结合上一篇的异步加载数据,今天我们就 ...
- ExtJs4 SpringMvc3 实现Grid 分页
新建一个Maven webapp项目,webxml以及spring配置没什么需要注意的,不再赘述. Maven依赖:(个人习惯,有用没用的都加上...) <project xmlns=" ...
- extjs grid 分页
在使用extjs创建带分页功能的 grid 如下: 1.创建一个模型 // 创建算定义模型 模型名称 User Ext.define('User', { extend: 'Ext.data.Model ...
- Ext4.1 Grid 分页查询
转载:http://blog.csdn.net/zyujie/article/details/16362747 最近用Ext4.1自己做了做项目的练习:把一些知识点,在这里记录下来了! 上面一个for ...
随机推荐
- php 文件file常用的操作
多是代码形式呈现,更多的信息可以查看php api文档,搜索Filesystem; //创建文件夹 $path_find = AppRoot . '/Temp/excel_curl'; //查找的路径 ...
- 《C和指针》读书笔记 第5章-操作符和表达式
原创文章,转载请注明出处:http://www.cnblogs.com/DayByDay/p/3936503.html
- liux环境下配置jdk
大家都知道,现在JAVA的发展可谓是如日中天,它覆盖面非常广泛,小到个人PC,大到商业应用都能见到它的身影.以前它是由SUN公司来维护的,现在已经归属到甲骨文旗下了. 今天我们来学习一下Java JD ...
- 【转】bash调试经验
原文网址:http://blog.csdn.net/yfkiss/article/details/8636758 bash是Unix/Linux操作系统最常用的shell之一,它非常灵活,和awk.c ...
- Maps
Maps.uniqueIndex()将列表转换为map //iterator各个元素作为Map.values, key为Function.apply返回值 Maps.uniqueIndex(ps.i ...
- Delphi实现文件关联
文件关联为我们带来很多的方便.Delphi自带有注册表对象TRegistry,可以通过它取得或改变注册表相关键值的内容. Function GetAssociatedExec(FileExt: Str ...
- matlab 调用VLfeat库开篇问题
准备工作见此网站 :http://cnyubin.com/?p=85 保存关闭startup.m文件后 重新打开matlab后 在命令行输入path或者vl_version无法检测到库已安装到matl ...
- 14个最受欢迎的Python开源框架
本文从GitHub中整理出的14个最受欢迎的Python开源框架.这些框架包括事件I/O,OLAP,Web开发,高性能网络通信,测试,爬虫等. Django: Python Web应用开发框架 Dja ...
- 面试java简答题
1. sleep() 和 wait() 有什么区别? 答:1.这两个方法来自不同的类分别是Thread和Object 2.最主要是sleep方法没有释放锁,而wait方法释放了锁,使得其他 ...
- sql统计重复数据
sql代码如下: 统计重复的数据 select MingCheng from tabShouFeiGongShi group by MingCheng having count(MingCheng) ...