DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
      • can-view-live.attr
      • can-view-live.html
      • can-view-live.list
      • can-view-live.text
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-view-live
  • /
  • can-view-live.list
  • / On this page
    • can-view-live.list

      function
      • source

      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

      1. el {HTMLElement}:

        An html element to replace with the live-section.

      2. list {can-compute|can-list|can-define/list/list}:

        An observable list type.

      3. render {function(index, index)}:

        A function that when called with the incremental item to render and the index of the item in the list.

      4. context {Object}:

        The this the render function will be called with.

      5. parentNode {HTMLElement}:

        An overwritable parentNode if el's parent is a documentFragment.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.