ExtJS infinite scroll

Achieving infinite scrolling only requires doing work on the store
extjs has two Store types that can achieve infinite scrolling, namely BufferedStore和 Ext.data.virtual.Store
Only the virtual store is available in the modern toolkit, so only the virtual store is mentioned here
Configure the viewModel's store
 
memberinfono: {
    autoLoad:true,
    type:'virtual',
    ...................
    ...................
    proxy: {
        type:'ajax',
        url : '..............',
        reader: {
            type: 'json',
            rootProperty: 'memberinfo.data',
            totalProperty: 'memberinfo.totalItemCount',
        }
    }
}

 

 
 
Read the paging parameters in the extjs request on the server and return the corresponding data.
 
if(isset($_GET['page']))
    $page=$_GET['page']-1;
if(isset($_GET['limit']))
    $pageSize=$_GET['limit'];

 

 
 
You can also specify the request parameter name through the proxy's pageParam configuration and limitParam configuration

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326336086&siteId=291194637