Titanium - How to close View that is defined in another .js file -


i have 1 window defined in firstview.js , view defined in settings.js.

i add settings view firstview window doing this:

var settings = require('ui/common/settings'); var settings = new settings(); self.add(settings); 

and now, when users press "back" button need remove settings view main window. know self.remove(settings) if both codes in same .js file.

but, in case, how can remove settings view main firstview window?

try use application level events.

in settings.js , when click on button

ti.app.fireevent("backsetting"); 

and in firstview.js

ti.app.addeventlistener("backsetting",function(e){                        self.remove(setting);                     }; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -