Cinder doesn’t paginate
I’m trying to get cinder to paginate but it shows all data regardless.
Cinder version: 0.5.5
<Cinder.Table.table
page_size={[default: 25, options: [10, 25, 50, 100]]}
resource={MyApp.MyResource}
actor={@current_user}
>
According to the doc, it should be sufficient to paginate. What am I missing?
15 Replies
Solution
Does your resource definition enable pagination for the relevant action?
how many records are there to display?
@Rebecca Le Tens of thousands. But since it refuses to paginate it crashes out of memory so I artificially limited them to 100 in the resource and it shows all 100 with no pagination.
🤔
I have another resource in the millions. You really need the filters to get something useful in that app.
Anything I can do to debug what’s happening?
Is pagination enabled in the resource for the action you're using in the table?
Oh… Nope, didn’t enable it in the resource. I thought it was happening in the table.
That explains things.
you should have gotten a warning about that
nothing in the logs?
Nothing.
query that identifies me with ash auth, query that fills the table, nothing in between
thats surprising, there should be a warning like
00:04:01.619 [warning] Cinder loaded 1 records for non-paginated action :by_name. Consider enabling pagination on this action for better performance.
. i'll look into why that might not be happeningWhile cinder is loading, it displays “loading”, can I translate this?
you can specify the
loading_message
option on the tableNeat.
found the issue - we're not correctly checking for pagination on the action, we were only logging an error when the number of records was over a certain threshold (which your initial query was, but then that crashed)
this is fixed in main now 🙂
Yeah, quite over. 🤣