in Titanium for iPhone, how to transition from table view to detail view.?
I have created a table view and want that when i click a cell then a new window should appear and my cell data should be displayed in that window!!!!....
here my code goes...
var table1 = Titanium.UI.createTableView(
{
data:[
{title:"Row 1 - simple row"},
{title:"Row 2 - Having child", hasChild:true},
{title:"Row 3 - with Details",hasDetail:true},
{title:"Row 4 - with Check",hasCheck:true},
{title:"Row 5 - red background",background开发者_如何转开发Color:"#f00"}
]
});
table1.addEventListener('click', function(e){
if (e.rowData)
{
var win5 = Titanium.UI.createWindow({
//url:e.rowData.test,
title:e.rowData.title
});
win5.open();
}
})
win1.add(table1);
var table1 = Titanium.UI.createTableView(
{
data:[
{title:"Row 1 - simple row", url:"<Specify the whole path of your detail.js file>"},
{title:"Row 2 - Having child", hasChild:true, url:"<Specify the whole path of your detail.js file>"},
{title:"Row 3 - with Details",hasDetail:true, url:"<Specify the whole path of your detail.js file>"},
{title:"Row 4 - with Check",hasCheck:true, url:"<Specify the whole path of your detail.js file>"},
{title:"Row 5 - red background",backgroundColor:"#f00", url:"<Specify the whole path of your detail.js file>"}
]
});
table1.addEventListener('click', function(e){
if (e.rowData)
{
var win5 = Titanium.UI.createWindow({
url:e.rowData.url,
title:e.rowData.title
});
win5.open({animated:true});
}
})
win1.add(table1);
Hope this helps you.
精彩评论