In my template, I call a server-side method to add an item to a collection. This collection is displayed on the page. Once the new item is rendered, I want to focus it for the u
One option may be observeChanges
? Can you try this?
in the rendered function do following
Template.postsAdmin.rendered = function(){
var query = Posts.find({}); //your query
var handle = query.observeChanges({
added: function (id, user) {
//code to set focus???
}
});
}
This code runs whenever there is a new item addeded to minimongo which matches your query.
Make sure to show the template after you load the data.
docs link http://docs.meteor.com/#/full/observe_changes