Closed warappa closed 13 years ago
update renders the template, so the element this will be removed from the DOM when you call update. Therefore $(this).tmplItem() will not be what you want on the next line.
var item = $(this).tmplItem()
item.data; // returns associated model fragment
// manipulate data
item.update(); // update renderes template with the updated data
// data gets rendered correctly
var test = item.data; // data is not empty!
When a template element is updated, the data associated with the element is lost (more specific: the whole jQuery data object is lost).
Result: Data is empty.
Expected: Data should be preserved.
Lg warappa