Are Meteor template events lost if the template is relocated within the DOM? -
i have 2 lists appear adjacent each other on page. list items can dragged 1 list other, , vice-versa (using jquery.sortable). list item template, within button. click event button defined using template.my-button.events method.
when page rendered, if click button in list item, events fire ok. if, however, drag list item adjacent list, events no longer fire.
does know why and/or can suggest way circumvent issue?
it possible jquery.sortable messes meteor events tracker. maybe not elegant way possible work-around add eventlistener through classic js in template.page.onrendered()
. like:
template.yourpage.onrendered(function() { document.getelementbyid("yourbuttonid").addeventlistener("click", function() { #your code }); })
Comments
Post a Comment