Felix Junghans
Felix Junghans

Reputation: 152

chunk results of meteor Easy Search

Hi I use the matteodem:easy-search package for Meteor. Right now I am chunking my results into groups of size

Template.UserList.helpers({
  users: function () {
    all = Meteor.users.find().fetch();
    chunks = [];
    size = 3;
    while (all.length > size) {
      chunks.push({ row: all.slice(0, size)});
      all = all.slice(size);
    }
    chunks.push({row: all});
    return chunks;
  }
});

and it works like a charme, but now I want to know how to do this with

{{#EasySearch.Each index=playersIndex }}

since you can't split the Index. Anyone have an idea to get EasySearch.Each work with Bootstrap row?

thanks.

Upvotes: 2

Views: 218

Answers (1)

Christian Fritz
Christian Fritz

Reputation: 21364

Looking at what EasySearch.Each does (https://github.com/matteodem/meteor-easy-search/blob/master/packages/easysearch:components/lib/each/each.js) it seems that you can just use

index.getComponentMethods().getCursor()

once you've created your index, i.e., just replace your find call with the above and it might work.

Upvotes: 1

Related Questions