简体   繁体   English

如何在Alloy框架Titanium SDK(Appcelerator)中打开现有控制器

[英]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.

相关问题 Appcelerator Titanium(Alloy)-打开另一个包含新窗口的控制器 - Appcelerator Titanium (Alloy) - Open another controller containing a new window Appcelerator钛合金MVC:“ $”有什么用? - Appcelerator Titanium Alloy MVC: how is '$' useful? Appcelerator钛合金:如何在ScrollableView上存储数据以在单击事件中使用 - Appcelerator Titanium Alloy: How to store data on a ScrollableView to use in click event Appcelerator /钛合金-如何在将字符串添加到视图之前对其进行操作 - Appcelerator / Titanium Alloy - how to manipulate a string before it gets added to the view 钛合金,需要控制器 - Titanium Alloy, Require Controller 在Appcelerator钛合金项目中使用节点模块 - Using node modules in Appcelerator Titanium Alloy Project Appcelerator钛/合金模型:如何修改此排序方法以对包含数字的字符串进行排序 - Appcelerator Titanium / Alloy Models: How do I modify this sorting method to sort a string that contains numbers 如何删除带有Alloy Framework的Titanium? - How may I delete using Titanium with Alloy Framework? $ in运算符Titanium SDK不起作用#appcelerator - $in operator titanium sdk not working #appcelerator Appcelerator Titanium-openFileChooserDialog不存在:如何打开对话框浏览文件? - Appcelerator Titanium - openFileChooserDialog does not exist: How to open a dialog to browse for a file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM