reactive-table
reactive-table copied to clipboard
Does using ReactiveTable.publish automatically paginate on the server side?
Say my collection has 10,000 rows and I have a page size of 50 - do I need to include the logic for selecting only the records for the current page in the collection parameter, or is this done automatically?
So would the code below:
ReactiveTable.publish("paginatedData", myData)
return 50 rows to the client, or all 10,000? In my settings I am specifying both currentPage and rowsPerPage.
I read through the docs, but wasn't quite sure how it behaved
It's automatic, it only returns the rows for the current page.
@aslagle but there is still the issue that everything is published to the client #467 and the first loading take a while, when having a big database. Anyway it could be changed to only publish the wanted rows ?
I had a same problem. the problem is issue with
fullCursor.observeChanges
try to disable observeChanges by using the followed setting:
{
disablePageCountReactivity: true
}
also you can add disableRowReactivity: true to the setting
full publish code would be like this:
ReactiveTable.publish("publishName", collection, {}, {
disablePageCountReactivity: true,
disableRowReactivity: true
});