extjs - How to disable pagination on a store
Asked Answered
M

5

8

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 ?

Melodize answered 16/10, 2013 at 7:19 Comment(1)
Unfortunately there doesn't seem to be a way to apply this workaround when creating stores in Sencha Architect v2.2.2.Facient
S
3
store: {
    pageSize: 0,
    limit:0,
....
}

excluding from the request

page: __

start: __

limit: ___

Skiplane answered 3/3, 2017 at 16:11 Comment(1)
For my stores with localstorage proxy, I used store.load({limit: 1}) successfully.Melodize
W
4

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.

Warden answered 16/10, 2013 at 7:48 Comment(2)
This would disable all the parameter functionality. This is not intended.Melodize
You can also extend the proxy class and override this method and not only with Ext.emptyFn, but with a customized getParams methodWarden
S
3
store: {
    pageSize: 0,
    limit:0,
....
}

excluding from the request

page: __

start: __

limit: ___

Skiplane answered 3/3, 2017 at 16:11 Comment(1)
For my stores with localstorage proxy, I used store.load({limit: 1}) successfully.Melodize
S
2

I set:

pageSize: 0,

in the model config.

Shivery answered 29/6, 2015 at 20:7 Comment(0)
F
0

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

Finnigan answered 16/11, 2017 at 10:2 Comment(1)
undefined also works. This is not an improvement for me.Melodize
A
-2

set the following on the store:

{
    defaultPageSize: null
}
Ambert answered 7/5, 2014 at 7:35 Comment(1)
No, this doesn't work. It has no effect on pagination.Melodize

© 2022 - 2024 — McMap. All rights reserved.