20. Extjs学习笔记——Ext.data.JsonStore使用说明
Ext.data.JsonStore继承于Ext.data.Store,使得从远程JSON数据创建stores更为方便的简单辅助类。JsonStore合成了Ext.data.HttpProxy与Ext.data.JsonReader两者。如果你需要其他类型的proxy或reader组合,那么你要创建以Ext.data.Store为基类的配置。
代码实例:
|
1
2
3
4
5
6
7
|
<code class="hljs lasso">var store = new Ext.data.JsonStore({ id:'id', url: 'get-images.php', root: 'images', totalProperty: 'rowCount', fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]});</code> |
他的返回值将形成如下的对象:
|
1
2
3
4
5
6
7
|
<code class="hljs css">{ images: [ {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)}, {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)} ]}</code> |
下面我们依次说明下几个参数的含义:
id(String):用来唯一标识
url(String):如果有值传入,会为该URL创建一个HttpProxy对象
root(String):JSON对象的key指定,这里指的是服务器传递过来的json变量的命名
totalProperty:这里指的是查询出来的条数,也是由服务器传递过来
fields(Object[]):对象数组集合
在实际应用中fields我们可以使用遍历list等方式往里面传值。
20. Extjs学习笔记——Ext.data.JsonStore使用说明的更多相关文章
- Extjs学习笔记——Ext.data.JsonStore使用说明
Ext.data.JsonStore继承于Ext.data.Store.使得从远程JSON数据创建stores更为方便的简单辅助类. JsonStore合成了Ext.data.HttpProxy与Ex ...
- Extjs学习笔记--Ext.tree.Panel
Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, store: store, rootVisi ...
- Extjs 学习笔记1
学习笔记 目 录 1 ExtJs 4 1.1 常见错误处理 4 1.1.1 多个js文件中有相同的控件,切换时无法正常显示 4 1.1.2 Store的使用方法 4 1.1.3 gridPanel ...
- extjs 学习笔记(二)
EXTJS实用开发指南 1. 要使用ExtJS 框架的页面中一般包括下面几句: <link rel="stylesheet" type="text/css" ...
- Extjs学习笔记--(一vs增加extjs智能感知)
1,编写class.js var classList=[ "Ext.layout.container.Absolute", "Ext.layout.container.A ...
- Ext.data.JsonStore的使用
最近在维护一个Ext.js写的贷前服务系统,Ext.data.JsonStore相当于前台页面的一个数据仓库,负责保存后台传过来的Json数据,具体用法如下: var store12=new Ext. ...
- ExtJS笔记 Ext.data.Types
This is a static class containing the system-supplied data types which may be given to a Field. Type ...
- ExtJS笔记 Ext.data.Model
A Model represents some object that your application manages. For example, one might define a Model ...
- ExtJs学习笔记之学习小结LoginDemo
ExtJs学习小结LoginDemo 1.示例:(登录界面) <!DOCTYPE html> <html> <head> <meta charset=&quo ...
随机推荐
- windows事件查看器
如果一个软件发生异常,软件本身没有提示异常信息, 需要从事件查看器中查看产生的错误事件 运行输入eventvwr或者win + X
- LeetCode(55)Jump Game
题目 Given an array of non-negative integers, you are initially positioned at the first index of the a ...
- Uva 839天平(二叉树dfs, 递归建树)
题意: 给定一个天平长度 输入格式为 wl dl wr dr 分别代表天平左边长度,左边重量, 右边长度, 右边重量. 如果重量为0, 说明下面还有一个天平, 递归给出. 样例输入:10 2 0 40 ...
- java发送短信验证码的功能实现
总结一下发送短信验证码的功能实现 (题外话:LZ是在腾讯云买的第三方(山东鼎信)短信服务平台的接口,1块钱20次的套餐来练手,哈哈,给他们打个广告,有需要的可以去购买哈,下面是购买链接短信服务平台购买 ...
- POJ3107 树的重心
题解:只不过如果有求多个点,输出所有方案. #include<cstring> #include<cmath> #include<iostream> #includ ...
- [K/3Cloud] 调用其他界面时通过Session传递对象参数
DynamicFormShowParameter参数的CustomParams参数列表只支持string类型的参数,对于复杂参数的传递需要通过单据View对象的共享Session来完成,如: 在调用界 ...
- next_permitation
了解一个C++ STL的函数 next_permitation 可用于生成全排列 如下例子 #include <iostream> #include <stdio.h> #in ...
- Bzoj3038 上帝造题的七分钟2 并查集
Time Limit: 3 Sec Memory Limit: 128 MBSubmit: 1135 Solved: 509 Description XLk觉得<上帝造题的七分钟>不太 ...
- ZOJ 2770_Burn the Linked Camp
题意: 给定每个兵营的最大容量,以及第i到第j个兵营至少有多少个士兵,问所有兵营一共至少有多少个士兵? 分析: 差分约束系统,注意 第i到第j至少有k个 第i到第j最多有最大容量之和个 每个兵营至少有 ...
- [bzoj1014][JSOI2008]火星人prefix_非旋转Treap_hash_二分
火星人prefix bzoj-1014 JSOI-2004 题目大意:给定一个字符串,支持三种操作:1.查询:两个后缀之间的$LCP$:2.单点修改:3.插入一个字符. 注释:$1\le n\le 1 ...