Store和Jsonstore的用法简单解析

1、store

运用proxy发送请求的store

var store=new Ext.data.Store({
                  proxy : new Ext.data.HttpProxy({// 配置数据源代理
                url : 'GI/gameInfo_searchByFields.action',
                timeout:3000
              }),
             reader:new Ext.data.JsonReader({
                   totalProperty : 'totalProperty', //这里指的是查询出来的条数,也是由服务器传递过来的
                   root : 'root'   //JSON对象的key指定,这里指的是服务器传递过来的json变量的命名
             }, [   
                      {name:'service_id'},
                      {name:'inline_type'},
                       {name:'realname'},
                       {name:'phoneno'},
                       {name:'mainaccountid'},
                       {name:'servicegame'},
                       {name:'gameaccount'},
                       {name:'questiontype'},
                       {name:'inline_time'},
                       {name:'created_time'},
                       {name:'pcall_id'},
                       {name:'closed_csrname'},
                   ])
           });



后面的这些是服务器传递过来的参数json对象里面的key,这个要一一对应的


2、JSONStore


直接配置url的JsonStore

   //创建一个jsonstore

   var IOStore = new Ext.data.JsonStore({
        url: 'login!listPatterns.action',
        root: 'patternList',
        fields: ['workPatternId', 'patternName']
    });

这里的fields在前面的combo中提到过。这两个元素是分别对应的返回来数据的不懂的话可以去那片blog中看看





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值