codepb/jquery-template

loadTemplate , afterInsert problem

Closed this issue · 1 comments

loadTemplate with an array of JSON objects the the afterInsert callback cannot set data and events to the current element: Example:

function afterInsert(el,data) {
el.data('mydata',data);
}

work arround:
$('#bla').loadTemplate('tpl.html', local_data[0], options);
$('#bla').loadTemplate('tpl.html', local_data[1], options);
$('#bla').loadTemplate('tpl.html', local_data[2], options);

I'm not sure what you are trying to do here?