[英]How to open a existing controller in Alloy framework Titanium SDK (Appcelerator)
i am not been able to open a existing Alloy controller within another controller .js file. 我无法在另一个controller .js文件中打开现有的Alloy控制器。
i have tried opening the controller using require method but returned exceptions. 我尝试使用require方法打开控制器,但返回了异常。
// On click Function Index.js //单击功能Index.js
function Done(e) {
if(($.user.value=="admin") && ($.pass.value=="123"))
{
alert($.user.value);
var ne = require('home');
ne.open();
$.index.close();
}
}
$.index.open();
Where Home is a Alloy Controller. Home是合金控制器。
Exception Caught are :- 被发现的例外是:
Thanks for Help. 感谢帮助。
If I understand correctly, you want to instantiate the 'home' controller and open its window. 如果我理解正确,您想实例化“家庭”控制器并打开其窗口。
var ne = Alloy.createController('home').getView();
ne.open();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.