extjs JsonStore详解

其实学习extjs当然是看API最好了,呵呵,这里结合extjsAPI对他配置属性做一些介绍

this.gridStore = new Ext.data.JsonStore({
                proxy : new Ext.data.HttpProxy({
                    method : 'POST',
                    url : '${ctx}/${appPath}/Servicesignup/index',
                    disableCaching : false
                }),
                autoDestroy : true,
                root : 'data',
                totalProperty : 'count',
                fields : [ 'serviceid', 'servicename','servicepath','publishpath', 'servicestate', 'deploytime', 'registetime', 'provider', 'userid', 'intfacedesc', 'securitytype', 'order' ],
                remoteSort : true,
                sortInfo : {
                    field : 'order',
                    direction : 'ASC'
                },
                baseParams : {
                    start : 0,
                    limit : 20
                }
            });

这个是我的JsonStore其实baseParams,proxy,sortInfo是JsonStore自己的一些配置项,不懂得可以去看API,当配置URL的时候其实自动就配置了proxy无论你自己是否配置,当然添加了proxy后URL就可以写在里面了

我们看HttpProxy的API

The Connection object (Or options parameter to Ext.Ajax.request) which this HttpProxyuses to make requests to the server. Properties of this object may be changed dynamically tochange the way data is requested.

基本意思就是我们可以按照Ext.Ajax.request的方式请求数据,并添加他的配置项,所以里面的配置就不难理解了

还有就是root ,totalProperty也不是HttpProxy配置项我们还是看API

 A JsonStore will be automatically configured with a Ext.data.JsonReader.

这样我们就不难理解了有些属性是JsonReader的


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值