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使用说明的更多相关文章

  1. Extjs学习笔记——Ext.data.JsonStore使用说明

    Ext.data.JsonStore继承于Ext.data.Store.使得从远程JSON数据创建stores更为方便的简单辅助类. JsonStore合成了Ext.data.HttpProxy与Ex ...

  2. Extjs学习笔记--Ext.tree.Panel

    Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, store: store, rootVisi ...

  3. Extjs 学习笔记1

    学习笔记 目   录 1 ExtJs 4 1.1 常见错误处理 4 1.1.1 多个js文件中有相同的控件,切换时无法正常显示 4 1.1.2 Store的使用方法 4 1.1.3 gridPanel ...

  4. extjs 学习笔记(二)

    EXTJS实用开发指南 1. 要使用ExtJS 框架的页面中一般包括下面几句: <link rel="stylesheet" type="text/css" ...

  5. Extjs学习笔记--(一vs增加extjs智能感知)

    1,编写class.js var classList=[ "Ext.layout.container.Absolute", "Ext.layout.container.A ...

  6. Ext.data.JsonStore的使用

    最近在维护一个Ext.js写的贷前服务系统,Ext.data.JsonStore相当于前台页面的一个数据仓库,负责保存后台传过来的Json数据,具体用法如下: var store12=new Ext. ...

  7. ExtJS笔记 Ext.data.Types

    This is a static class containing the system-supplied data types which may be given to a Field. Type ...

  8. ExtJS笔记 Ext.data.Model

    A Model represents some object that your application manages. For example, one might define a Model ...

  9. ExtJs学习笔记之学习小结LoginDemo

    ExtJs学习小结LoginDemo 1.示例:(登录界面) <!DOCTYPE html> <html> <head> <meta charset=&quo ...

随机推荐

  1. Anaconda基本用法

    Anaconda基本用法 conda info --envs/(-e) // 查看当前的环境变量 conda create -n py36(环境的名称,随意) python=3.6(指定版本) //  ...

  2. Spider-Python爬虫之聚焦爬虫与通用爬虫的区别

    为什么要学习爬虫? 学习爬虫,可以私人订制一个搜索引擎. 大数据时代,要进行数据分析,首先要有数据源. 对于很多SEO从业者来说,从而可以更好地进行搜索引擎优化. 什么是网络爬虫? 模拟客户端发送网络 ...

  3. LeetCode(61) Rotate List

    题目 Given a list, rotate the list to the right by k places, where k is non-negative. For example: Giv ...

  4. STM32F407 GPIO原理 个人笔记

    datasheet(STM32F407ZGT6.pdf)中,IO structure 为FT,表示容忍5V电压 后面的uart1_TX之类,表示端口复用 共有A~G7组IO口, 每组16个IO口:0~ ...

  5. BNUOJ 26283 The Ghost Blows Light

    The Ghost Blows Light Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. O ...

  6. zoj4710暴力

    #include<stdio.h> #include<string.h> #define N 110 int map[N][N]; int main() { int n,m,k ...

  7. 图解Elasticsearch中的_source、_all、store和index属性

    https://blog.csdn.net/napoay/article/details/62233031

  8. 使用HttpClient调用第三方接口

    最近项目中需要调用第三方的Http接口,这里我用到了HttpClient. 首先我们要搞明白第三方接口中需要我们传递哪些参数.数据,搞明白参数以后我们就可以使用HttpClient调用接口了. 1.调 ...

  9. Git回退---reset和revert

    今天学习了git回退的两个命令,现在总结一下: 1.git reset 如果想回退错误的提交C和D,只要把指针移到B上 git reset --hard a0fvf8 而这时候,远程仓库的指针还在D上 ...

  10. MongoDB小结24 - 索引简介2

    索引的名字 集合中每个索引都有一个字符串类型的名字,来唯一标识索引. 服务器通过名字来操作或者删除索引. 要注意的是,索引名有字符个数限制,所以索引创建时一定要用自定义的名字,如 db.user.en ...