Javascript 在Tianium for iPhone中,如何从表视图过渡到详细视图。?
我已经创建了一个表视图,希望当我单击一个单元格时,会出现一个新窗口,并且我的单元格数据会显示在该窗口中 这是我的密码Javascript 在Tianium for iPhone中,如何从表视图过渡到详细视图。?,javascript,iphone,objective-c,cocoa-touch,titanium,Javascript,Iphone,Objective C,Cocoa Touch,Titanium,我已经创建了一个表视图,希望当我单击一个单元格时,会出现一个新窗口,并且我的单元格数据会显示在该窗口中 这是我的密码 var table1 = Titanium.UI.createTableView( { data:[ {title:"Row 1 - simple row"}, {title:"Row 2 - Having child", hasChild:true}, {title:"Row 3 - with Details",hasDe
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",backgroundColor:"#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);
希望这对您有所帮助。确切的问题是什么?详细信息视图是否未打开或新视图上的详细信息文本未被传输?当我单击单元格时。。模拟器挂起…我觉得您指定的文件路径或url有问题。您的文件是直接在Resources文件夹中还是在某个子文件夹下?您能发布有关如何传递文件路径或url的代码吗?
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);