Passing data from child window to parent
I have a tableviewrow, i added a click event that opens a new window. When the new child window is closed, i would like to pass back to the parent tableviewrow a value. How can I do this? I see how to pass data from the parent tableviewrow to the child window it spawns, but now I need the data to go back from child to parent since it can be changed on the child window.
1 Answer
-
Accepted Answer
You will want to use events to pass back to the parent. This developer blog entry should help.
Basically the parent needs an event listener like:
Ti.App.addEventListener('myCustomEvent', function(event) { Ti.API.info('You sent me: '+event.myCustomEventValue); });
The child needs to fire an event:
Ti.App.fireEvent('myCustomEvent', { myCustomEventValue: 'someValue' });