Hi,
I am assuming that your data is array of data.
When you navigate from the MainPage to DetailsPage on the itemInvoked method, pass the index also.
MainPage
itemInvoked: function (args) {
var index = args.detail.itemIndex;
WinJS.Navigation.Navigate("<Path for the detail page>",
{ indexCurrent : index, data : <pass the data list/array> });
},
In the detail page ready event, assign the datasource and set the
current page property to the index that was passed.
DetailsPage
ready: function(element,options)
{
var flipView = document.getElementById("flipView").winControl;
var data = options.data;
var list = new WinJS.Binding.List(data);
var sortedList = list.createSorted(<function for sort>);
flipView.itemDatasource = sortedList.dataSource;
flipView.currentPage = options.indexCurrent;
// Set to what you have passed.
},
For ordering the list data and the sorting function, you can have a look at this
link.
- Girija