钛合金开口标签组存在问题
Issue with open tab group in titanium
我在一个选项卡组中有4个选项卡。单击选项卡名称时的选项卡转换工作正常。但我需要在点击选项卡3中的按钮事件时从选项卡3打开选项卡2。我该怎么做。
样本代码,
<Alloy>
<Tab id="one">
<Window class="container">
<Label>This is the Home View</Label>
</Window>
</Tab>
<Tab id="two">
<Window class="container">
<Label>This is the second View</Label>
</Window>
</Tab>
<Tab id="three">
<Window class="container">
<Button onClick="saveLang">Proceed</Button>
</Window>
</Tab>
</Alloy>
控制器:
function saveLang()
{
// How can we open only tab2 here
// I tried open index, the loading time taking long and also it is opening tab1 But I need to open tab2 for this event
}
我目前不在我的系统上,我可以提到的问题/评论仍然很少:
首先,我怀疑你的标签不会正常工作,因为它们没有包含在TabGroup中。
所以你的观点应该是:
<Alloy>
<TabGroup id="myTabGrp"> //Tabgroup Added
<Tab id="one">
<Window class="container">
<Label>This is the Home View</Label>
</Window>
</Tab>
<Tab id="two">
<Window class="container" id="winTwo">
<Label>This is the second View</Label>
</Window>
</Tab>
<Tab id="three">
<Window class="container">
<Button onClick="saveLang">Proceed</Button>
</Window>
</Tab>
</TabGroup>
</Alloy>
现在,当saveLang
方法在控制器中被调用时,我们可以调用setActiveTab
方法:
function saveLang() {
$.myTabGrp.setActiveTab($.two);
}
编辑:要重新加载/刷新选项卡中窗口的内容,请在控制器中添加窗口的焦点事件:
$.winTwo.addEventListener('focus',function(e) {
alert('focus');
});
希望有帮助。
相关文章:
- IE9的HTML5 Canvas getImageData()函数存在问题
- JSP 中的“日期”字段存在问题
- 在 AngularJS 中显示信息的标记存在问题
- javascript中的数组和if语句存在问题
- TypeError:$(..).higharts不是函数-现有解决方案不起作用-Yeoman生成器存在问题
- 我的Firefox插件和跨域https存在问题
- jquery中的setOptions存在问题
- 数据在确认框中的显示方式存在问题
- javascript className函数存在问题
- document.referrer存在问题
- 日期选择器UI存在问题
- .replacement()存在问题
- 安卓phonegap应用程序与三星Galaxy设备上的SQlite和本地存储存在问题
- jQuery 在文本路径 svg 元素方面存在问题
- Node JS http-proxy - 创建的 URL 存在问题
- JavaScript 中的 IF 语句存在问题
- JavaScript 函数的绑定方法存在问题
- App Engine 上的 Google 可视化 API 存在问题
- 简单的浏览器扩展程序,但存在问题
- Youtube Data API 集成存在问题