Hi there, I am developing an application at the moment and I am trying set up a picker in which users can select an option and it takes them to a page appropriate to their choice. However I am having trouble opening the selected page, can someone help!
Here is my code:
var picker = Ti.UI.createPicker(); var data = []; data[0]=Ti.UI.createPickerRow({title:'Test1', url:'Test1.js'}); data[1]=Ti.UI.createPickerRow({title:'Test2', url:'Test2.js'}); picker.add(data); picker.addEventListener('click',function(evt) { var window = Titanium.UI.createWindow({url:evt.row.url, backgroundColor:'#fff'}); var button = Titanium.UI.createButton({title:'Back'}); win.leftNavButton= button; button.addEventListener('click', function() { win.remove(window); win.leftNavButton = null; }); }); win.add(picker);
1 Answer
Dont worry I got there myself!
Your Answer
Think you can help? Login to answer this question!