Answer the question
In order to leave comments, you need to log in
How to make a filter in a directory in MeteorJS?
Good day. There was such a question - how to make a filter for the catalog on MeteorJS?
What is available: a directory with certain objects that have a pack (9 pcs.) of bool-type properties, the site has a list with checkboxes that should control the displayed objects. For the second day I can not find a solution, I ask for help here - how can this be implemented? The main thing is that it works, so to speak :)
Answer the question
In order to leave comments, you need to log in
If on a standard delivery of a meteor (without react or angular), then as an option to do it through sessions.
When publishing data from the server, on the client in any case you have a similar line
Template.productList.helpers({
products: function() {
return Product.find();
})
Template.productList.helpers({
products: function() {
return Product.find(Session.get('filterStatus'));
})
Template.productList.events({
'click #allProducts': function() {
Session.set('filterStatus', {});
},
'click #filterStatus1': function() {
Session.set('filterStatus', {
status: 1
});
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question