Customize number of table rows per page

I would really like our users to be able to customize how many rows they see per page in a table, but binding a value to props.pager.initialOption does not work. I know I can change the various selections in the dropdown, but that's pretty useless because whatever they choose won't stick--every time they view the page, it will start out at whatever value I decide on for initialOption, and they'll have to change it, which they'll quickly tire of doing once they realize their change isn't permanent...

Do you have either or props.pager.bottom set to True? I found with both set to False the table doesn't do any pagination. Also with the initialOption, the value you are using in your binding must exist as an available option in props.pager.options as well.

Yes, I have set to True, and the value(s) I try setting initialOption to using a binding DO exist in props.pager.options.

Store their selection in a session property and do a bidirectional bind to that.
If you do nothing else, that will at least let their selection persist for the session, you will need to initialise it to something in the session start event.
If you want it to extend beyond that, you could store the users preference in a tag or database and push that into the session prop when they log in rather than use a default. Make sure you store it again if they change it. I do exactly this with some table filters and even with the theme the user chooses, it's pretty seamless.

What is it bound to ?

A database query

Unless the data pulled from the query is not an integer, there's no reason this shouldn't work.
I'll give it a shot and see what happens.

Yea it works just fine.
Create a session.custom property, let's call it row_per_page.
Bind that property to your named query.
Then bind the table's props.initialOption to session.custom.row_per_page.

I can't get it to work when creating the most basic table in a brand new project and binding it to a session variable (which is static, not bound to anything else). When I first launch the URL for that page, the table shows 25 rows, and only after I hit browser refresh does it change to the 5 that I set as the session variable...


My bad, it's doing the same thing for me, I'm not sure what I was looking at yesterday.

I guess it's a case similar to the powerchart's source, where the first load of the component seem to ignore the binding...