实现无限滚动只需要在store上做工作就可以了
extjs有两个Store类型可以实现无限滚动,分别是
BufferedStore和Ext.data.virtual.Store
在modern toolkit中只有virtual store可用,所以这里只讲virtual store
配置viewModel的store
memberinfono: { autoLoad:true, type:'virtual', ................... ................... proxy: { type:'ajax', url : '..............', reader: { type: 'json', rootProperty: 'memberinfo.data', totalProperty : 'memberinfo.totalItemCount', } } }
服务器上读取extjs请求中的分页参数返回对应的数据就可以了
if(isset($_GET['page'])) $page=$_GET['page']-1; if(isset($_GET['limit'])) $pageSize=$_GET['limit'];
也可以通过proxy的pageParam配置和limitParam配置指定请求参数名