Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

ListView : Passign data of the clicked item to an other.js

$
0
0

I have a list view of countries, when I click at the item I want to get the detail in the other .js

How can i get the name and the details of the selected country my code is like this:

function loadData() {
var data = nomCountrydata.slice(currentListMarker,  currentListMarker + maxFetchRows);
var listData = [];
var isPortrait = Titanium.Gesture.orientation == Titanium.UI.PORTRAIT || Titanium.Gesture.orientation == Titanium.UI.UPSIDE_PORTRAIT;
for(var i=0,j=data.length; i<j; i++){
  listData.push({
    nomCountry: { text : data[i].name, width: '50%' },
    ImgCountry: { image : data[i].ImgCountry, width:'50%', visible: isPortrait }
  }); 
};

currentListMarker += maxFetchRows;
nomCountrySection.appendItems(listData);
nomCountryList.setMarker({sectionIndex:0, itemIndex:nomCountrySection.items.length -1});

} nomCountryList.addEventListener('itemclick', function(e) {

    var winn = Ti.UI.createWindow({ 
         url:'CountryDetail.js',

         row_title : e.itemIndex,
         backgroundColor: '#f9f9f9',
         title:'Detail Country'
     });
     winn.open();

});


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>