您的位置:首页 > 其它

Ext4之Store发送Ajax请求不带limit、page、start

2013-10-30 14:19 567 查看
刚开始看Ext4没多久,被新的结构弄得晕头转向的。今天发现所有的store发送的Ajax请求都会带上limit、page、start,即使前台上没有使用分页。而我不想要有这些参数。网上查了很久,都没有查到相关资料。最后我看了源文件Ajax.js,看到里面的说明有这样一个类Ext.data.proxy.Ajax,如下

 * var proxy = new Ext.data.proxy.Ajax({

 *         url: '/users',

 *         startParam: 'startIndex',

 *         limitParam: 'limitIndex'

 *     });


然后去看相应的API文档,果然发现了解决方法,在store的配置属性proxy的配置对象里,将limitParam、pageParam、startParam分别设置成undefined,如下

[b]proxy: {

                  type: 'ajax',

                  url: 'user/search.do',

                  reader: {

                      type: 'json',

                      root: 'rows',

                      totalProperty: 'total'

                  },

                  limitParam:undefined,

                  pageParam:undefined,

                  startParam:undefined

              }
[/b]

[b]完成。
[/b]

在查资料的过程中发现几篇不错的博客,如果熟悉Ext2或者Ext3的人,可以阅读一下这些资料,只不过有一些错别字。在这里保存一下链接,与大家一起分享:

预览ExtJS 4.0的新功能/新特性(一):渲染组件的方式 http://blog.csdn.net/zhangxin09/article/details/5964716 

href="http://blog.csdn.net/zhangxin09/article/details/5984004" target=_blank>预览ExtJS 4.0的新功能(二):客户端的对象关系映射(ORM)http://blog.csdn.net/zhangxin09/article/details/5984004

预览ExtJS 4.0的新功能(三):客户端数据层的革新:引入ActiveRecord模式http://blog.csdn.net/zhangxin09/article/details/5995194

预览ExtJS 4.0的新功能(四):焕然一新的Store/Proxy http://blog.csdn.net/zhangxin09/article/details/6027890

href="http://blog.csdn.net/zhangxin09/article/details/6028365" target=_blank>预览ExtJS 4.0的新功能(五):焕然一新的Store/Proxy http://blog.csdn.net/zhangxin09/article/details/6028365

href="http://blog.csdn.net/zhangxin09/article/details/6047126" target=_blank>预览ExtJS 4.0的新功能(六):读写器/Opeartion http://blog.csdn.net/zhangxin09/article/details/6047126

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ext4 store page limit ajax