Hi, i am doing a Splitview App for Ipad, i have to refresh my tableview in my masterview each time the user clicks on a button (this button is in another window), how can i do? thanks
2 Answers
Accepted Answer
You can add Application event for executing code from another window. for example :
Ti.App.addEventListener("customEvent",function(e){ // Do process. });Fire event from your window where button placed in split view.
Ti.App.addEventListener("customEvent");Remember one thing, the Event Listener should be added only once in whole execution of Application.
First of all you need to fire the event in the click-event of the button:
Ti.App.fireEvent("updateTable", { newData: [{title: 'New Data1'},{title: 'New Data 2'}] }and then listen to the fired event in the TableView:
Ti.App.addEventListener("updateTable",function(e){ tableView.setData([e.newData] });
Your Answer
This question has been locked and cannot accept new answers.