// file.html
<div id="RankingTemplate" data-win-control="WinJS.Binding.Template" >
<h2>
<span class="Number" data-win-bind="innerText:place"></span>
<span id="ratingControlDiv"
data-win-control="WinJS.UI.Rating"
data-win-bind="winControl.averageRating: rating"
data-win-options="{maxRating:5,disabled:true}"></span>
<label for="ratingControlDiv" data-win-bind="innerText : votes"></label>
<span class="Name" data-win-bind="innerText : title"></span>
</h2>
</div>
<div id="RankingList"
data-win-control="WinJS.UI.ListView"
data-win-options="{
itemDataSource : sourceData.itemRankingData.dataSource,
itemTemplate : RankingTemplate,
tapBehavior: 'none',
swipeBehavior : 'none',
layout: {type: WinJS.UI.ListLayout}
}"></div>
// file.js
var dataRankingArray = [
{
place: 1,
rating: 4.75,
votes: "(2500000 votes)",
title: "Marius"
},
{
place: 2,
rating: 4.5,
votes: "(190 votes)",
title: "Napolis"
},
{
place: 3,
rating: 3.8,
votes: "(200 votes)",
title: "Oliva Restaurant"
},
{
place: 4,
rating: 3.42,
votes: "(215 votes)",
title: "Tucano Coffe"
},
{
place: 5,
rating: 3.1,
votes: "(197 votes)",
title: "Robert's Coffe"
}
];
var dataRankingList = new WinJS.Binding.List(dataRankingArray);
var publicMembers =
{
itemRankingData: dataRankingList
};
WinJS.Namespace.define("sourceData", publicMembers);
//screenshoots
When the app is loaded the homepage look like in the before image, and all is working correctly.
before http://imgur.com/0BCpUeP
When I try to navigate from the current page(Home) , to the same page (Home) with the navigation control the list isn't loading the template.And the result is shown in the next image.
after http://imgur.com/rEoQLRd