2011-08-09 9 views
0

私はテーブルビューを作成して、セルをクリックすると新しいウィンドウが表示され、そのセルデータがそのウィンドウに表示されるようにしたいと思っています!!!! ...、テーブルビューから詳細ビューへの移行方法

ここに私のコードが入ります。

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); 
+0

正確な問題は何ですか?詳細ビューが開いていないか、または詳細テキストが新しいビューで転送されていませんか? –

+0

私がセルをクリックすると、シミュレータがハングアップする.... – DShah

+0

ファイルパスまたは指定しているURLに問題があると感じます。 –

答えて

0
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); 

これはあなたのお役に立てば幸いです。

関連する問題