locked
How can you programmatically bind a listView?

    Question

  •  I have a listview that's defined as follows:

    <div id="listView" data-win-control="WinJS.UI.ListView" data-win-options="{layout: {type: WinJS.UI.ListLayout}}"></div>

    and I'm trying to databind it programmatically using:

     var listView = document.getElementById("listView").winControl;  

     listView.dataSource = posts; 

      listView.itemRenderer = template;

    nothing appears on screen. This code used to work in the developer preview, but is not working on consumer preview.
    Am I doing something wrong? how would I go about debugging this?

    Thanks.


    http://blogs.microsoft.co.il/blogs/eladkatz @ElatKt

    Sunday, March 18, 2012 10:29 PM

Answers