sematable icon indicating copy to clipboard operation
sematable copied to clipboard

how can I specify a default page size of 'All'?

Open pgoldweic opened this issue 7 years ago • 4 comments

I've been asked to have my table display All of the elements by default, while still offering the 'page size' menu for those users who prefer to select a given page size. Is this supported? In my (old) build of sematable - version 1.4.4- I noticed that if I select a default page size that is, for example, 999 (something really long), then the page size displays incorrectly (it says '5' of -whatever the actual size is-). Is there any way to get this behavior to work in the current version? (that is, either specifying directly that the size should be 'All', or specifying a large enough value to simulate this). Thanks in advance! (and thanks for providing this very useful component!)

pgoldweic avatar Feb 20 '18 18:02 pgoldweic

Hi @pgoldweic. Can you please try using -1 (https://github.com/sematext/sematable/blob/master/src/PageSize.js#L16) as the default page size when configuring your sematable?

We should probably export this constant from sematable though so you can use it instead of hard coding -1.

amir-hadzic avatar Feb 20 '18 19:02 amir-hadzic

Thanks for your response! Sure, can try this out (yes, it would definitely be nice for you to export the variable in the future). Should I also assume this will only work with the current version of sematable? Or do you think there's a chance it will also work with 1.4.4? Thanks in advance.

pgoldweic avatar Feb 20 '18 19:02 pgoldweic

It should work with 1.4.4. as well.

amir-hadzic avatar Feb 20 '18 19:02 amir-hadzic

That's great! Thanks again.

pgoldweic avatar Feb 20 '18 19:02 pgoldweic