I'm trying to render different pages of elements (pagination) with transitions with jquery, when I render the first page its all fine, but when the transition occurs all the events that I attached to my elements disappear and I dont know exactly why, .html()
seems to be deleting them on the second render, not sure how I can pass them, thought .clone(true,true)
was enough, but no.
var transition_default = function(offsetStart, offsetEnd) {
plugin.currentElements.hide();
plugin.currentElements = plugin.settings.objElements.slice(offsetStart, offsetEnd).clone(true,true);
plugin.el.html(plugin.currentElements);
plugin.currentElements.show();
};
Any help or correction will be appreciated.
Update 1: Seems this guys had almost the same issue, but im not completely sure how to apply that question solutions to my case. Backbone: event lost in re-render
Update 2: Found out how to apply the solution .detach(), see my answer below.