dojox.grid.DataGrid
创建表格
<table data-dojo-type="dojox.grid.DataGrid" data-dojo-id="grid" style="height: 90%" id="grid" data-dojo-props="rowsPerPage:'5'">
<thead>
<tr>
<th field="name" width="100%">项目名称</th>
</tr>
</thead>
</table>
1、清除数据
var newStore = new dojo.data.ItemFileReadStore({data: { identifier: "", items: []}});
var grid = dijit.byId("grid");
grid.setStore(newStore);
2、增加数据
/**
* 显示地图点.
* json的格式[{"name":"name1","x":"x1","y":"y1","img":"img1","content":"content1"}...]
*/
var griddata = {
//类似于主键,值唯一,唯一标示一个graphic
identifier: "PROJECT_ID", //This field needs to have unique values
label: "PROJECT_ID", //Name field for display. Not pertinent to a grid but may be used elsewhere.
items: json
};
//Create data store and bind to grid.
var store = new dojo.data.ItemFileReadStore({ data:griddata });
var grid = dijit.byId('grid');
grid.setStore(store);
//表格行点击的监听事件,关联到地图
dojo.connect(grid, "onRowClick", onRowClickHandler);
//点击项目名称列表
function onRowClickHandler(evt){
var clickedTaxLotId = grid.getItem(evt.rowIndex).name;
alert(clickedTaxLotId.toString());
}
dojox.grid.DataGrid的更多相关文章
- dojox.grid.EnhancedGrid 和 dojox.grid.DataGrid 的继承关系
dojox.grid.EnhancedGrid 的介绍说, EnhancedGrid 是基于 DataGrid 提供增强功能的. EnhancedGrid (dojox.grid.EnhancedG ...
- dojox.grid.DataGrid显示数据的方法(转)
第一种:数据存在本地或者已经写死的JSON对象中,不需要跟服务端进行数据传输 <%@ page language="java" contentType="text/ ...
- dojo中的dojox/grid/EnhancedGrid表格报错
1.错误截图 2.错误出处 <body class="claro"> <div id="gridContainer"> <span ...
- jQuery EasyUI API - Grid - DataGrid [原创汉化官方API]
最近在学习jQuery EasyUI,发现中文的文档好少,部分文档不错但它是鸟语的,为了大家也为了自己学习吧,汉化做一下笔记. 有没有说清楚的,或者翻译不正确的地方还请大家谅解指出.. 由于工作时间原 ...
- dojo grid 编辑问题
今天dojo grid编辑小问题,找了半天才找到问题, 1.问题 2.原因 数据单元没有索引列->id 3.修改前代码 <!DOCTYPE HTML> <html lang=& ...
- dojo DataGrid实现表格数据编辑的解决方案
在官网上看见的DataGrid编辑非常简单,但我实现的时候总是出现问题.经过N久的摸索,终于搞定了,期间出现了多处困难,下面说些解决办法的流程. 我实现的表格在页面加载时是不显示数据,只有通过表单像服 ...
- dojo Datagrid 实现数据删除功能
DataGrid实现数据动态刷新功能见前一个帖子:http://www.cnblogs.com/qq552048250/p/4447103.html 实现数据删除只需要向表格中动态添加按钮,并为按钮的 ...
- struts2+dojo实现datagrid动态刷新
实现一个普通的数据库查询功能,参考了这个帖子:http://stackoverflow.com/questions/5499453/how-to-refresh-datagrid 需要注意的是动态创建 ...
- struts2+dojo实现datagrid
ACTION: package test.action; import java.util.ArrayList; import java.util.HashMap; import java.util. ...
随机推荐
- jenkins使用deploy-plugin自动构建部署war包
jenkins+ant+maven+tomcat 1安装 jenkins 使用yum安装的 # 下载库 wget -O /etc/yum.repos.d/jenkins.repo http://pkg ...
- js console 一些拓展技巧
console.time 方法 / console.timeEnd() 方法 统计一段代码的执行时间, 形参必须一致 console.time("string"); for(var ...
- 屏蔽Enter触发的事件
无论是 <button type="button" onclick="console.log('123');">123</button> ...
- CommonUtils.java
package com.vcredit.framework.utils; import java.lang.reflect.InvocationTargetException;import java. ...
- 【iCore3 双核心板】例程十九:USBD_MSC实验——虚拟U盘
实验指导书及代码包下载: http://pan.baidu.com/s/1i4eNbQd iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...
- INSTRUCTION CYCLE
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION • Fetch: Read the nex ...
- Java 隐藏和覆盖
我们知道,在JAVA中,子类可以继承父类,如果子类声明的方法与父类有重名的情况怎么办,大伙儿都知道要是重写,但是实际上这又分为两种情况,就是方法和变量在继承时的覆盖和隐藏问题,这些概念性的东西看似无聊 ...
- C输入输出函数与缓冲区
#转 对C语言输入输出流和缓冲区的深入理解C语言缓冲区(缓存)详解缓冲区又称为缓存,它是内存空间的一部分.也就是说,在内存空间中预留了一定的存储空间,这些存储空间用来缓冲输入或输出的数据,这部分预留的 ...
- C++程序设计(二)
1. 类 class CRectangle { public: int w, h; void Init( int w_, int h_ ) { w = w_; h = h_; } int Area() ...
- 真正的让iframe自适应高度 兼容多种浏览器随着窗口大小改变
今天有朋友问到我关于"iframe自适应高度"的问题,原本以为是很简单的问题,没想到折腾了20分钟才搞定.期间遇到几个问题,要么是高度自适应了,但是当窗口改变时会出现滚动条.也就是 ...