Closed dharmiksolanki1992 closed 7 years ago
Sorry I don't have an example of that. The ready
setting only works if you're using ReactiveTable.publish on the server, and have other code that needs to know when the data is ready on the client. If that applies to you, you can create a ReactiveVar with new ReactiveVar()
, and add it to the table arguments, and check it in other parts of your code. It will start out false and change to true when the data is ready.
Using ReactiveVar we can get subscription is ready or not.
Template.myTemplate.onCreated(function(){
this.isSubscriptionReady = new ReactiveVar(false);
});
Template.myTemplate.helpers({
settings: function () {
return {
collection: collection,
rowsPerPage: 10,
showFilter: true,
fields: ['name', 'location', 'year'],
ready: Template.instance().isSubscriptionReady
};
},
isSubscriptionReady: function () {
return Template.instance().isSubscriptionReady.get();
}
});
@aslagle Is there any way to achieve this for when changing pages or filters?
i have used meteor reactive-table https://github.com/aslagle/reactive-table for show data listing. how to use ready: ReactiveVar(Boolean) option in settings code. give example.