javascript - Correct way to open a new window in Appcelerator Titanium -
i have rather large app made in appcelerator titanium, i've not ported sdk version 3.2 because ti.ui.window's "url" property has been removed, application uses extensively. unfortunately, have not been able find new, correct way this. info i'm finding out there point removal of url property, or suggests should move alloy (which @ moment not doable me require complete rewrite of app). can point me example of right way should done?
if you're not using alloy, it's 2 step process. first need handle window. done ti.ui.createwindow (see http://docs.appcelerator.com/platform/latest/#!/api/titanium.ui-method-createwindow). have reference window, open it. so,
var win = ti.ui.createwindow({title: 'my first window'}); win.open();
documentation on window object here. http://docs.appcelerator.com/platform/latest/#!/api/titanium.ui.window
if have windows defined in other js files. ie. mywindow.js, can use require js window. have code in window return "window" object, open that.
ie. mywindow.js
var win = ti.ui.createwindow({title: 'window file'}); return win;
then in calling file, don't use url, require window:
var mynewwindow = require('mywindow'); mynewwindow.open();
you can see information calling require here: http://docs.appcelerator.com/platform/latest/#!/api/global-method-require
hope helps.
ray
Comments
Post a Comment