list
2.0.4Live binds a compute's can.List incrementally.
live.list(el, compute, render, context, parentNode, nodeList, falseyRender, list) 2.0.4
Live binds a compute's can.List incrementally.
Parameters
-
el
{HTMLElement}
An html element to replace with the live-section.
-
compute
{*}
-
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}
OptionalAn overwritable parentNode if
el
's parent is a documentFragment.Use
can.view.live.list
is used to setup incremental live-binding.// a compute that change's it's list var todos = can.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>" })
-
nodeList
{*}
-
falseyRender
{*}
-
list
{can.compute(getterSetter, context) | can.List}
A can.List or can.compute whose value is a can.List.