简体   繁体   English

单击tableRow时,不在tabGroup中打开新窗口(钛)

[英]open new window not in tabGroup when tableRow is clicked (titanium)

I have 4 windows all linked together with tabs. 我有4个窗口,所有页面均与标签链接在一起。 on the last tab (helpTab), it has a table with two rows, to 'email for help' or 'watch tutorial.' 在最后一个选项卡(helpTab)上,该表具有两行表格,用于“通过电子邮件发送帮助”或“观看教程”。 I would like the user to be able to click on either row which will take them to either the 'emailWindow' or the 'videoWindow'. 我希望用户能够单击任一行,将其带到“ emailWindow”或“ videoWindow”。 These windows are not in the tabGroup. 这些窗口不在tabGroup中。 I was trying to add a navGroup to the helpTab window, but when I do this the simulator will not run. 我试图将一个navGroup添加到helpTab窗口,但是当我这样做时,模拟器将无法运行。

I don't really understand the way navGroups work within a tabGroup. 我不太了解navGroup在tabGroup中的工作方式。 Can anyone suggest a way that I can add a navGroup to a tabGroup? 谁能建议我可以将navGroup添加到tabGroup的方法吗? or if this is even possible? 或者这是否有可能? (i have only written code for the emailWindow so far. Because I can't get this to work, I thought there is not point in writing incorrect code twice!) I hope I have provided enough information. (到目前为止,我只为emailWindow编写了代码。由于无法正常工作,我认为两次编写不正确的代码是没有意义的!)希望我提供了足够的信息。 Thank you 谢谢

var helpWindow = Ti.UI.createWindow({
    //code to create window
});

helpWindow.open();

var rootWindow = Ti.UI.createWindow();
var navGroup = Ti.UI.iPhone.createNavigationGroup({
    window: helpWindow
});
rootWindow.add(navGroup);
rootWindow.open();

// add table etc (normal code with 2 rows)

row1.addEventListener('click', function(e){
    navGroup.open(emailWindow);
});

solved: 解决了:

I moved 我搬家了

rootWindow.open();

into the eventListener 进入eventListener

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM