Listview 如何在钛合金列表视图中定位单个项目?

Listview 如何在钛合金列表视图中定位单个项目?,listview,titanium-alloy,Listview,Titanium Alloy,在钛合金中,如何在钛列表视图中专门针对第一个项目(我只需要更改第一个项目的背景色) 使用listview查看: <ListView id="hm_channel_comments" defaultItemTemplate="hm_commentTemplate"> <ListSection name="hm_comments" id="hm_comments_section"/> 需要(a)获取特定listsection的listItemObject,并(b)更新它。类

在钛合金中,如何在钛列表视图中专门针对第一个项目(我只需要更改第一个项目的背景色)

使用listview查看:

<ListView id="hm_channel_comments" defaultItemTemplate="hm_commentTemplate">
<ListSection name="hm_comments" id="hm_comments_section"/>
需要(a)获取特定listsection的listItemObject,并(b)更新它。类似这样的内容(当您只想将listSection第一项的backgroundColor更改为navy时):

groups.xml包含id为“myTeamSectionJoined”的listsection

groups.js:

function disableOwnBuddyTransfer(){
    var groupFounder = $.myTeamSectionJoined.getItemAt(0);
    console.log("groupFounder" + JSON.stringify(groupFounder));
    groupFounder.d_four.backgroundColor = "navy";
    $.myTeamSectionJoined.updateItemAt(0, groupFounder);
}
真正有用的信息在

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