2011-08-09 5 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); 

희망.

관련 문제