locked
Namespace issue

    Question

  • This is the html code

    <div id="basicListView"
    data-win-control="WinJS.UI.ListView"
    data-win-options="{ itemDataSource : DataExample.itemList.dataSource }">
    </div>


    This is the JS code to connect to it

    var myData = new WinJS.Binding.List([
       { title: "Basic banana" },
       { title: "Banana blast" }
        ]);

    var publicMembers =
                             {
                                 itemList: myData
                             };
    WinJS.Namespace.define("DataExample", publicMembers);

    When this is run it produces the expected output on the screen (I do not have a template yet)
    The issue is when I read the data in from Azure and substitute it for myData  the error issued
    says cannot find itemList which I believe is referring to the Namespace not being found. What
    is the best way to handle this.

    Thanks

     

    Wednesday, October 22, 2014 2:49 PM

All replies

  • Hi baryo,

    "When this is run it produces the expected output on the screen", looks like your code works fine, but I would like to know how you read the data from Azure and can you confirm the data has been successfully read to your WinJS? The error probably tell you itemList does not have any data inside.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, October 23, 2014 7:56 AM
    Moderator