2014-12-22 2 views
1

티타늄 합금, 티타늄 목록보기의 첫 번째 항목을 구체적으로 타겟팅 할 수 있습니까 (첫 번째 항목 만 배경색을 변경해야합니까?). 목록보기와티타늄 합금 목록 뷰에서 개별 항목을 어떻게 타겟팅합니까?

보기 : 몇 가지 시도 필자

<ListView id="hm_channel_comments" defaultItemTemplate="hm_commentTemplate"> 
<ListSection name="hm_comments" id="hm_comments_section"/> 

는 (항상 "정의되지 않은"반환) : 특정 listsection와의 listItemObject (A)하려면

$.hm_channel_comments.Item[0].setBackgroundColor("blue"); //not working 
$.hm_comments_section.itemIndex[0].setBackgroundColor("blue"); //not working 
console.log($.hm_comments_section.itemIndex[0] + " $.hm_comments_section.itemIndex[0] "); not working 
console.log($.hm_comments_section.item[0] + " $.hm_comments_section.item[0] "); 

답변

0

하나의 요구를 (B) 그것을 업데이트하십시오. 이와 같이 (backgroundColor를 listSection의 첫 번째 항목의 네이비로 변경하려는 경우) :

groups.xml에는 "myTeamSectionJoined"라는 ID가있는 목록 섹션이 포함되어 있습니다.

groups.js :

function disableOwnBuddyTransfer(){ 
    var groupFounder = $.myTeamSectionJoined.getItemAt(0); 
    console.log("groupFounder" + JSON.stringify(groupFounder)); 
    groupFounder.d_four.backgroundColor = "navy"; 
    $.myTeamSectionJoined.updateItemAt(0, groupFounder); 
} 

정말 유용한 정보가 http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_ListView_Guide

에있다
관련 문제