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

hasmore function, pagintation? #71

Open
marcojferreirac opened this issue May 26, 2015 · 9 comments
Open

hasmore function, pagintation? #71

marcojferreirac opened this issue May 26, 2015 · 9 comments
Labels

Comments

@marcojferreirac
Copy link

Hello!

I've been using the app for quite a while now. I noticed that it has a "hasMore" function, which is for pagintation right?
Although i can't get it to work... Where can i set the limit? How can i show only, for example, 3 results and then press a next button to show the next 3 results?

Thank you very much for your help!

@radiegtya
Copy link
Owner

in the Controllers at func subscriptions and index, simply override this value

sort.limit = this.limit();

to

sort.limit = 3;

but it's not reccomended

the reccommended one is ovverride the increment variable in your controller add this:

increment: 3

or if you want to set the whole app with limit 3, simply edit the MeteorisController increment value

@marcojferreirac
Copy link
Author

Editing the increment value worked, but now a button should appear to load more results, but doesnt.

thank you!

@radiegtya
Copy link
Owner

which one from my answer did you used @marcojferreirac ?

@marcojferreirac
Copy link
Author

Editing the MeteorisController increment value. But now, even if my collection has 10 fields, i can only access 3. The others aren't loaded/can't be accessed.

@radiegtya
Copy link
Owner

loadmore button also not showing?

@marcojferreirac
Copy link
Author

yes, the loadmore button doesn't appear.

@radiegtya
Copy link
Owner

can You Please give your code at MeteorisController and YourController?

@marcojferreirac
Copy link
Author

My MeteorisController code is the same as the one in gitHub, only changed "increment: 3".

My controller's code is the generated code, only changing the sort.limit in the "subscriptions" function, like below:

ItemsController = MeteorisController.extend({
 subscriptions: function() {
        var sort = MeteorisGridView.getSorting();
        sort.limit = 3;
        this.subs.subscribe('ccdocs', {});
        this.subs.subscribe('descriptions', {});
        this.subscription = this.subs.subscribe('items', this.getCriteria(), sort);
    },
});

@radiegtya
Copy link
Owner

Hi @marcojferreirac, I think you get me wrong. You shouldn't change the sort limit inside subscribe function, that will just subsrcibe 3 data from server and no more hardcoded. I mean you must change the MeteorisController itself, not the child. And you should change the increment variable value, not the limit.

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

No branches or pull requests

2 participants