reactive-table icon indicating copy to clipboard operation
reactive-table copied to clipboard

Does using ReactiveTable.publish automatically paginate on the server side?

Open Broham opened this issue 9 years ago • 3 comments

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

Broham avatar Oct 24 '16 17:10 Broham

It's automatic, it only returns the rows for the current page.

aslagle avatar Oct 24 '16 22:10 aslagle

@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 ?

aessig avatar Oct 27 '17 09:10 aessig

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
});

goolz avatar Jan 01 '19 08:01 goolz