今天dojo grid编辑小问题,找了半天才找到问题,

1、问题

2、原因

数据单元没有索引列->id

3、修改前代码

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo: Editing in a Grid</title>
<link rel="stylesheet" href="dijit/themes/claro/claro.css" media="screen">
<link rel="stylesheet" href="dojox/grid/resources/Grid.css" />
<link rel="stylesheet" href="dojox/grid/resources/claroGrid.css" />
</head>
<body class="claro">
<h1>Demo: Editing in a Grid</h1>
<p>The following grid shows the multiple editing capabilities built into dojox/grid/DataGrid.</p>
<div id="grid"></div>
<!-- load dojo and provide config via data attribute -->
<script src="dojo/dojo.js" data-dojo-config="isDebug: true, async: true"></script>
<script>
require([
"dojox/grid/DataGrid",
"dojox/grid/cells",
"dojo/store/Memory",
"dojo/data/ObjectStore",
"dojo/domReady!"
], function(DataGrid, cells, Memory, ObjectStore ){
var grid;
gridLayout = [{
defaultCell: { width: 8, editable: true, type: cells._Widget, styles: 'text-align: right;' },
cells: [
{ name: 'Date', field: 'col8', width: 10, editable: true},
{ name: 'Priority', styles: 'text-align: center;', field: 'col1', width: 10},
{ name: 'Mark', field: 'col2', width: 5, styles: 'text-align: center;'},
{ name: 'Status', field: 'col3',styles: 'text-align: center;' },
{ name: 'Message', field: 'col4', width: 10 },
{ name: 'Amount', field: 'col5'},
{ name: 'Amount', field: 'col5'}
]
}]; var data = [
{ col1: "normal", col2: false, col3: "new", col4: 'But are not followed by two hexadecimal', col5: 29.91, col6: 10, col7: false, col8: new Date() },
{ col1: "important", col2: false, col3: "new", col4: 'Because a % sign always indicates', col5: 9.33, col6: -5, col7: false, col8: new Date() },
{ col1: "important", col2: false, col3: "read", col4: 'Signs can be selectively', col5: 19.34, col6: 0, col7: true, col8: new Date() }
]; var objectStore = new Memory({data:data}); // global var "test_store"
test_store = new ObjectStore({objectStore: objectStore}); // create the grid.
grid = new DataGrid({
store: test_store,
structure: gridLayout,
"class": "grid"
}, "grid");
grid.startup(); });
</script>
</body>
</html>

4、修改地方

dojo grid 编辑问题的更多相关文章

  1. dojo grid 分页

    dojo很强大,也很方便,但是缺少文档,只能看源代码,也挺好的,就是费时间... 网上找了一段代码(找不到原出处了,不好意思),也看了dojo自带的demo,放一段可以执行的页面代码这里.把ip换成自 ...

  2. Dojo Grid结合Ajax用法

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerDefine ...

  3. asp.net中当点击按钮时出现grid编辑弹框

    <dx:ASPxButton runat="server" ID="NewGridButton" Text="新增授权" CssCla ...

  4. grid编辑后时间格式不对问题

    在column中应该定义xtype和format格式: xtype: 'datecolumn', format:'Y-m-d'   之后正常

  5. kendo ui 单击取消编辑数据grid减少的原因和治疗方法的数据

    kendo ui单击取消编辑数据buttongrid数据缩减.原因grid编辑数据追打datasorce于data寻找阵列数据的存在.假定有不会加入,加入缺席. 首先一个样本: html代码: < ...

  6. ExtJs4之Grid详细

    ExtJs博客前奏 由于这段时间事情比较杂乱,博客就主要以项目中例子来说明编写. ExtJs4中的Grid非常强大,有展示,选中,搜索,排序,编辑,拖拽等基本功能,这篇博客我就这几个功能做写累述. 1 ...

  7. 【Ext.Net学习笔记】06:Ext.Net GridPanel的用法(GridPanel 折叠/展开行、GridPanel Selection、 可编辑的GridPanel)

    GridPanel 折叠/展开行 Ext.Net GridPanel的行支持折叠/展开功能,这个功能个人觉得还说很有用处的,尤其是数据中包含图片等内容的时候. 下面来看看效果: 使用行折叠/展开功能之 ...

  8. Ext.Net学习笔记18:Ext.Net 可编辑的GridPanel

    Ext.Net学习笔记18:Ext.Net 可编辑的GridPanel Ext.Net GridPanel 有两种编辑模式:编辑单元格和编辑行. 单元格编辑: 行编辑: 可以看出,单元格编辑的时候,只 ...

  9. 【C#/WPF】TextBlock/TextBox/Label编辑文字的问题

    标题有点描述不清,就当是为了方便自己用时易于搜索到. 总之需求是:显示用户信息(文字)时,允许用户编辑自己的信息. 效果图如下: 点击[编辑]按钮前: 点击[编辑]按钮后,允许编辑: 别吐槽为甚性别还 ...

随机推荐

  1. W5200移植W5500驱动教程

    说明,移植例程为我按照这个教程移植的例程,测试通过.工程模板为我经常使用的一个w5500模板,可以在里面直接添加文件编程.1. 将driver文件夹中W5500文件夹和所有.c文件复制到工程/sour ...

  2. C++设计模式-Composite组合模式

    Composite组合模式作用:将对象组合成树形结构以表示“部分-整体”的层次结构.Composite使得用户对单个对象和组合对象的使用具有一致性. UML图如下: 在Component中声明所有用来 ...

  3. Python-9 函数

    #1 内建函数 乘方:pow() >>> pow(2,3) 8 >>> 取绝对值:abs() >>> abs(-1) 1 >>> ...

  4. 【练习】oracel获取当前session的id方法

    1. :: SYS; SID ---------- 2. :: SYS@ORA11GR2>SELECT USERENV('SID') FROM DUAL; USERENV('SID') ---- ...

  5. Android 调用系统联系人界面的添加联系人,添加已有联系人,编辑和修改。

    一.添加联系人 Intent addIntent = new Intent(Intent.ACTION_INSERT,Uri.withAppendedPath(Uri.parse("cont ...

  6. MVC执行过程

    HttpRuntime中的PR方法1,封装HttpContext2,获取HttpApplication 主要做3件事a,执行本事件时主要调用Init将Global编译得到类型,b,确保Appstart ...

  7. 安装和使用elasticsearch

    环境: win7 64位  jdk1.8.0  elasticsearch2.3.3 在官网下载elasticsearch2.3.3:https://www.elastic.co/thank-you? ...

  8. MacOS changed System Integrity Protection status

    禁止 System Integrity Protection 按住 command + R 重启系统 进入单用户模式 启动bash工具: 输入: csrutil disable 输入:reboot 启 ...

  9. [转]常用的快速Web原型图设计工具

    转自大神: http://www.cnblogs.com/lhb25/archive/2009/04/25/1443254.html 做产品原型是非常重要的一个环节,做产品原型就会用使用各式各样的工具 ...

  10. MacBook Pro/Air 下使用 linux ubuntu 系统 波浪号“~”变成其他 符号 的完美解决办法

    打开终端,输入: sudo su - > /sys/module/hid_apple/parameters/iso_layout sudo su -需要root权限,所以使用前请注意已下载roo ...