Quantcast
Channel: CHUVASH.eu » ajax
Viewing all articles
Browse latest Browse all 5

jQuery tmplItem and no ids

$
0
0

tmplItem() works even without ids. To get the current data:

$(this).tmplItem().data;

If you want to remove, just invoke the ajax and remove with $.parents:

$(this).parents("li").remove();
Updating data inside tmplItems

If you want to achieve some fancy dependency tracking, consider knockout.js. But if you just want to update the data object inside a tmplItem, just change the object and call update:

var t = $(this).tmplItem();
var obj = t.data;
obj.Address = "hello avenue";
t.update();


Viewing all articles
Browse latest Browse all 5

Trending Articles