locked
WinJS ListView data bind in render method RRS feed

  • Question

  • I would like to bind data (contentItem) to a WinJS ListView control in a render method.

    I have written:

     myapp.ViewTestRegion.RegionCollection2_render = function (element, contentItem) {
        var itemTemplate = $("<div id='maListView' data-win-control='WinJS.UI.ListView'></div>");
        itemTemplate.appendTo($(element));
    
        WinJS.UI.processAll().then(function ()
        {
            var listView = document.getElementById("maListView").winControl;
    // How can I bind contentItem to listView ?
    listView.itemDataSource = ???
    
        }

    But I do not know how to bind contentItem to the ListView control...


    Yves Pflieger

    Tuesday, March 31, 2015 1:06 PM

All replies