meteor-ios icon indicating copy to clipboard operation
meteor-ios copied to clipboard

Paginated Subscriptions?

Open nasserprofessional opened this issue 9 years ago • 1 comments

How can I use pagination with lots of records? I did try to implement it my self by modifying the todos example and connecting it up to a very basic meteor application which simply publishes a list of meteor users.

The problem is: I use override func configureSubscriptionLoader(subscriptionLoader: SubscriptionLoader) { subscriptionLoader.addSubscriptionWithName("something", parameters: skip, limit) }

In my load more function I use something like this: skip=self.tableView.numberOfRowsInSection(0) self.loadContent()

I did play around with adding it like this aswell

override func configureSubscriptionLoader(subscriptionLoader: SubscriptionLoader) { skip=self.tableView.numberOfRowsInSection(0) subscriptionLoader.addSubscriptionWithName("something", parameteres: skip, limit) }

Everything seems to work fine records are pagination but as soon as I add a new record on the server side it basically reloads everything in the table and because skip is using self.tableView.numberOfRowsInSection(0) it removes everything else from the tableview and just shows everything what was added last.

Is there anyway I can add pagination support / fix this issue?

nasserprofessional avatar Sep 03 '15 16:09 nasserprofessional

why dont you join new data array to the old then call reload table ?

nhattieunhatkiem avatar May 25 '16 14:05 nhattieunhatkiem