ExtJS -- ArrayStore
ArrayStore :
// Store for array
var myStore = new Ext.data.ArrayStore({
storeId: "arrayStore",
fields: ["ID", "Name"],
data: [ //Data Source
["1", "Array"],
["2", "Json"],
["3", "Xml"]
]
}); // Grid to display the Data
var myGrid = new Ext.grid.GridPanel({
renderTo: Ext.getBody(),
title: "Demo of Grid",
style: "width:400px; margin:10px;",
autoHeight: true,
store: Ext.StoreMgr.lookup("arrayStore"),
columns: {
items:[
{ header: "ID", dataIndex: "ID"},
{ header: "Name", dataIndex: "Name"}
],
defaults:{ // here, apply default config to each column
align: "center"
}
}
});
其中,关于 [store: Ext.StoreMgr.lookup("arrayStore")], 参考: http://kandy0619.blog.163.com/blog/static/6434434520091111104339833/
这个Store, 还可以这样创建:
//Data Source
var arrayData = [
[1, "Array"],
[2, "Json"],
[3, "Xml"]
];
// fields
var arrFields = [
{ name: "ID", mapping:0, type: "int"},
{ name: "Name", mapping:1, type: "string"}
];
//Store Container
var myStore = new Ext.data.Store({
storeId: "arrayStore",
data: arrayData,
fields: arrFields,
proxy:{
type: "memory",
reader:{
type: "array"
}
}
});
但是, 下面的这个就出错, 还是定义的问题?
var myStore = new Ext.data.Store({
storeId: "arrayStore",
//autoLoad: true,
proxy: new Ext.data.MemoryProxy(arrayData),
reader: new Ext.data.ArrayReader({id: 0}, arrFields)
});
直接不显示, 连个提示都木有???
又添加了:
myStore.loadData(arrayData);
Error: ’ TypeError: c is not a constructor ‘ 这是肿么回事???
ExtJS -- ArrayStore的更多相关文章
- ExtJs写本地ArrayStore,ComboBox调用
1.自定义本地ArrayStore var sCurStore = new Ext.data.ArrayStore({ //设备状态store fields: ["ckey", & ...
- [转]ExtJs:xtype的含义
原文地址:http://www.cnblogs.com/timy/archive/2010/08/13/1799111.html 根据我在EXT论坛上的观察,xtype用起来的时候疑惑会比较多.甚至有 ...
- Extjs 源码组成(4.0.7)
(function(){})()形式的自执行,构建Ext对象(0~584) 1 设置全局对象EXt:global.Ext = {}, 2 实现了Ext对象面向对象编程的基础方法,如,apply,ex ...
- ExtJs知识点概述
1.前言 ExtJS的前身是YUI(Yahoo User Interface).经过不断的发展与改进,ExtJS现在已经成功发布到了ExtJS 6版本,是一套目前最完整和最成熟的javascript基 ...
- extjs学习(关于grid)
1.想要调整某一列在表格中的顺序,可以使用mapping(索引是从0开始的) var store = new Ext.data.ArrayStore({ data:data, fields:[ {na ...
- ExtJs xtype类型介绍
自定义组件在定义的时候可以通过xtype配置为组件指定xtype短名称,此后创建对象可以通过xtype来创建自定义对象了,示例代码如下: Ext.define('MyApp.PressMeButton ...
- 无废话ExtJs 入门教程十五[员工信息表Demo:AddUser]
无废话ExtJs 入门教程十五[员工信息表Demo:AddUser] extjs技术交流,欢迎加群(201926085) 前面我们共介绍过10种表单组件,这些组件是我们在开发过程中最经常用到的,所以一 ...
- 无废话ExtJs 入门教程十一[下拉列表:Combobox]
无废话ExtJs 入门教程十一[下拉列表:Combobox] extjs技术交流,欢迎加群(201926085) 继上一节内容,我们在表单里加了个一个下拉列表: 1.代码如下: 1 <!DOCT ...
- ExtJs特点、优缺点及注意事项
摘自:ExtJs特点.优缺点及注意事项 1.什么是ExtJs?ExtJS可以用来开发RIA也即富客户端的AJAX应用,是一个用javascript写的,主要用于创建前端用户界面,是一个与后台技术无关的 ...
随机推荐
- Hash_bzoj1862: [Zjoi2006]GameZ游戏排名系统
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...
- SQL Server修改代理作业的下次运行时间
有这个现象,如果我把服务器时间调快2天运行作业,那么会发现作业的下次运行时间会变成两天+1的时间,即使是把服务器时间调正常后,这个下次运行时间也是无法调回来的 那么,要修改会正常的下次作业时间,可以这 ...
- FastCopy包含和排除文件夹处理
包含和排除文件夹操作: 1.有多个时,用[;]进行分割. 2.可指定文件夹深度,也可以不用指定,直接最终名称. 3.不用指定盘符. 4.名称后面带上反斜杠[\]. 假如有两个文件夹:F:\A,F:\B ...
- Linux Overflow Vulnerability General Hardened Defense Technology、Grsecurity/PaX
Catalog . Linux attack vector . Grsecurity/PaX . Hardened toolchain . Default addition of the Stack ...
- 《C陷阱与缺陷》杂记
第一章 词法"陷阱" 1.4整型常量 如果一个整型常量的第一个字符是数字0,那么该常量将被视作八进制数.因此,10与010的含义截然不同.需要注意这种情况,有时候在上下文为了格式& ...
- 【Beta】Scrum02
Info *由于28日大家事情比较多,推迟了一天 时间:2016.11.29 21:30 时长:10min 地点:大运村1号公寓5楼楼道 类型:日常Scrum会议 NXT:2016.12.01 21: ...
- Linux爆新漏洞,长按回车键70秒即可获得root权限
漏洞来源这个安全问题来源于Cryptsetup存在的一个漏洞(CVE-2016-4484).Cryptsetup是在Linux统一密钥设置(Linux Unified Key Setup, LUKS) ...
- BCE0019: '' is not a member of 'UnityEngine.Component'的问题
看自学网上的Unity3D的视频,其中视频中的实力代码: n.rigidbody.AddForce(fwd * 28000); 这个代码运行会出现错误: BCE0144: 'UnityEngine.C ...
- NOIp 0904 出题报告
T1 huajitree 纯模拟,把S拆成二进制查一下有多少个1,然后把这个数和N*M求一下gcd,除一下输出就好了.说求期望值可能对新高一不太友好…. //huajitree //2016.8.22 ...
- python redis使用心得
发布与订阅 连接池代码 redis_conn.py import redis REDIS_CONN = { 'HOST': '192.168.1.11', 'PORT': '6378', 'DB': ...