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

bash - How do you programmatically add a bats test? -

Unable to open serial port using Putty to bluetooth device on windows 7 64 bit -

java - Getting exception in JDBC thin driver -