extjs - How to disable pagination on a store

て烟熏妆下的殇ゞ 提交于 2019-12-04 12:01:53

问题


Whenever a store (Ext.data.Store) reads data from the server, it sends paging parameters like &page=1&start=0&limit=25 in a json proxy or [page:1, start:0, limit:25] using a direct proxy.

I'd like to disable paging in the store or proxy configuration.

I found this workaround, but I'm sure there must be a better method.

proxy: {
    pageParam: undefined,
    startParam: undefined,
    limitParam: undefined,
    ...
}

Does anyone know how to disable paging properly ?


回答1:


store: {
    pageSize: 0,
    limit:0,
....
}

excluding from the request

page: __

start: __

limit: ___




回答2:


Another option is to override the proxy's getParams method. This handles the groupers, sorters, filters, page, start and limit parameters. It's defined in Ext.data.proxy.Server

If you want to disable all Extjs used parameters, then you can simple replace it with an empty method:

proxy: {
    getParams: Ext.emptyFn,
    ...
}

You can also extend the proxy class and override this method.




回答3:


I set:

pageSize: 0,

in the model config.




回答4:


To disable pagination, you have to set the values to empty string, not undefined. Like so:

pageParam: '',
startParam: '',
limitParam: '',

This works for me in Ext JS 6.2




回答5:


set the following on the store:

{
    defaultPageSize: null
}


来源:https://stackoverflow.com/questions/19397359/extjs-how-to-disable-pagination-on-a-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!