list
live.list(el, list, render, context, [parentNode])
Live binds a compute's list incrementally.
// a compute that change's it's list
var todos = compute(function(){
return new Todo.List({page: can.route.attr("page")})
})
var placeholder = document.createTextNode(" ");
$("ul#todos").append(placeholder);
can.view.live.list(
placeholder,
todos,
function(todo, index){
return "<li>"+todo.attr("name")+"</li>"
});
Parameters
- el
{HTMLElement}
:An html element to replace with the live-section.
- list
{can-compute|can-list|can-define/list/list}
:An observable list type.
- render
{function(index, index)}
:A function that when called with the incremental item to render and the index of the item in the list.
- context
{Object}
:The
this
therender
function will be called with. - parentNode
{HTMLElement}
:An overwritable parentNode if
el
's parent is a documentFragment.