Created
August 15, 2012 01:51
-
-
Save shinriyo/3354737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tabGroup = Ti.UI.createTabGroup(); | |
var win1 = Ti.UI.createWindow({ | |
title: "win 1", | |
backgroundColor: "blue" | |
}); | |
var data = [ | |
{title:'Album 1', hasChild:true, dest:'album_1.js'}, | |
{title:'Album 2', hasChild:true, dest:'album_2.js'}, | |
]; | |
var table = Ti.UI.createTableView({ | |
data:data | |
}); | |
table.addEventListener('click', function(e){ | |
if(e.rowData.hasChild) { | |
var w = Ti.UI.createWindow({ | |
url: e.rowData.dest, | |
title: e.rowData.title, | |
backgroundColor: 'white' | |
}); | |
tab1.open(w); | |
} | |
}); | |
var view = Ti.UI.createView(); | |
view.add(table); | |
win1.add(view); | |
// 追加 | |
win1.open(); | |
var win2 = Ti.UI.createWindow({ | |
title: "win 2", | |
backgroundColor: "red" | |
}); | |
var tab1 = Ti.UI.createTab({ | |
icon: "KS_nav_views.png", | |
title: "Tab 1", | |
window: win1 | |
}); | |
/* | |
var tab2 = Ti.UI.createTab({ | |
icon: "KS_nav_ui.png", | |
title: "Tab 2", | |
window: win2 | |
}); | |
tabGroup.addTab(tab1); | |
tabGroup.addTab(tab2); | |
tabGroup.open(); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment