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写的,主要用于创建前端用户界面,是一个与后台技术无关的 ...
随机推荐
- 【BZOJ-2768】冠军调查 最小割
2768: [JLOI2010]冠军调查 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 971 Solved: 661[Submit][Status ...
- 【BZOJ-4522】密钥破解 数论 + 模拟 ( Pollard_Rho分解 + Exgcd求逆元 + 快速幂 + 快速乘)
4522: [Cqoi2016]密钥破解 Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 290 Solved: 148[Submit][Status ...
- 【BZOJ-3589】动态树 树链剖分 + 线段树 + 线段覆盖(特殊的技巧)
3589: 动态树 Time Limit: 30 Sec Memory Limit: 1024 MBSubmit: 405 Solved: 137[Submit][Status][Discuss] ...
- LINQ语法记录
static void Main(string[] args) { List<Person> persons = new List<Person>(); persons.Add ...
- codeforces 21D:Traveling Graph
Description You are given undirected weighted graph. Find the length of the shortest cycle which sta ...
- Jenkins 1.x权限配置(兼容2.x)
说明: 1.x版本的jenkins默认是没有任何权限限制,任何人都可以访问. 需要用到的插件: [Role-based Authorization Strategy] 具体配置: 0.设置Jenkin ...
- Search and Replace的正则表达式
以下例子均在Search and Replace中适用,EditPlus也有正则表达式,但有点不一样. 1.1 基本操作符 * 重复0次或更多次 + 重复一次或更多次 ? 重复一次 | 或 操作符 ! ...
- poj1379 模拟退火
题意:和上题一样...就是把最小值换成了最大值.. ref:http://www.cppblog.com/RyanWang/archive/2010/01/21/106112.html #includ ...
- Windows系统:桌面,开始菜单和工具栏都不见了
win7桌面,开始菜单和工具栏都不见了 ctrl+alt+del 打开任务管理器 然后文件-运行 --- 输入框里输入 explorer.exe 其实就是打开系统文件夹下的(大约是‘windows ...
- Mouse.OverrideCursor
介绍: 获取和设置整个应用程序的光标,WPF父元素将覆盖所有子元素的光标. WPF设置控件的光标: WPF 中每个光标通过一个System.Windows.Input.Cursor表示, 获取Curs ...