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

来源:互联网 发布:c 游戏编程 百度网盘 编辑:程序博客网 时间:2024/06/05 12:43

刚开始看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,如下

proxy: {
                  type: 'ajax',
                  url: 'user/search.do',
                  reader: {
                      type: 'json',
                      root: 'rows',
                      totalProperty: 'total'
                  },
                  limitParam:undefined,
                  pageParam:undefined,
                  startParam:undefined
              }

完成。

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

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

预览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

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

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

原创粉丝点击