locked
How may I dynamically change the dataSource of a listView?

    Question

  • Hi, I have the following div and I want to dynamically change the itemDataSource by clicking some radio buttons. i.e. how may I change myDataset1 to myDataset2 by an onclick event? Many thanks!

     <div id="listView" 
                    class="win-selectionstylefilled"
                    data-win-control="WinJS.UI.ListView" 
                    data-win-options="{ 
                        itemDataSource: myDataset1.dataSource, 
                        itemTemplate: mediumListIconTextTemplate, 
                        selectionMode: 'single', 
                        tapBehavior: 'directSelect', 
                        layout: { type: WinJS.UI.ListLayout },
                        oniteminvoked : selectionChangedHandler
                    }" style="width: 20%; top: 80%"
     ></div>


    Tuesday, September 3, 2013 2:03 PM