Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selector not working #430

Open
ekazaltzis opened this issue Apr 25, 2019 · 3 comments
Open

selector not working #430

ekazaltzis opened this issue Apr 25, 2019 · 3 comments

Comments

@ekazaltzis
Copy link

Hi,

I have upgraded my meteor application from 1.4 to 1.8 but unfortunately my tabular data is not working anymore. Basically I can see the first 10 records but when i click next page nothing happens. Additionally the sorting only works for the records shown instead triggering a new query.

Where did I go wrong because this used to work before the upgrade.

Regards,
Emanouil

@evolross
Copy link

This is good to know. I'm not sure of the answer, but this package hasn't been updated in 18 months. Have you tried checking out any of the forks to see if they work correctly? Would be curious to know as I have a 1.5.x app I want to upgrade to 1.8.x and I use this package a lot.

@evolross
Copy link

evolross commented May 1, 2019

There's also this package which looks to be an improvement. You could check this out:

https://bitbucket.org/znewsham/meteor-dynamic-tables/src/master/

@jorisroling
Copy link

jorisroling commented Aug 28, 2019

I've found that using the selector function reactive, it is runs (because of Tracker.autorun) too often and prevents going to the next page. By being careful with assigning to those ReactiveVars only when actually changed (see below) this is prevented.

I use this code (both server & client):

import { ReactiveVar } from 'meteor/reactive-var'
import equal from 'fast-deep-equal'

ReactiveVar.prototype.setIfChanged = function(val) {
  if (!equal(val,this.get())) {
    return this.set(val)
  }
}

and then use .setIfChanged(value) to make the selector only be called (autoran) when actual new values arrive.

Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants