Skip to content

Instantly share code, notes, and snippets.

@cameronpriest
Forked from dawsontoth/app.js
Created September 26, 2011 23:22
Show Gist options
  • Save cameronpriest/1243736 to your computer and use it in GitHub Desktop.
Save cameronpriest/1243736 to your computer and use it in GitHub Desktop.
Tab within a Tab
var tabGroupOuter = Ti.UI.createTabGroup();
tabGroupOuter.addTab(Ti.UI.createTab({
title: 'app.js',
window: Ti.UI.createWindow({
title: 'app.js',
url: 'middle.js',
backgroundColor: 'red'
})
}));
tabGroupOuter.open();
var containingWindow = Ti.UI.currentWindow;
var tabGroupInner = Ti.UI.createTabGroup();
tabGroupInner.addTab(Ti.UI.createTab({
window: Ti.UI.createWindow({
backgroundColor: 'blue'
})
}));
tabGroupInner.open();
var currentTab = Ti.UI.currentTab;
var button = Ti.UI.createButton({ title: 'open inner tab group' });
button.addEventListener('click', function() {
var win = Ti.UI.createWindow({
url: 'inner.js',
title: 'inner.js'
});
currentTab.open(win);
});
Ti.UI.currentWindow.add(button);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment