在我的鈦的應用程序,我必須展示元素的列表,這樣做我用以下幾種觀點:數據收集鈦列表視圖
<Alloy>
<Collection src="featuredEvents"/>
<Window id="win" class="container" navBarHidden="true" exitOnClose="true" onOpen="showIndicator">
<View id="navView"></View>
<ActivityIndicator id="activityIndicator" message="L('loading')" />
<TableView id="featuredEvents" dataCollection="featuredEvents" dataFilter="filterEvents" opacity="0" class="list">
<TableViewRow eventId="{alloy_id}" onClick="showEvent">
<View class="event-wrapper">
<ImageView image="{img}" eventId="{alloy_id}" defaultImage="/img/loading.jpg"/>
<View class="eventImageOverlayYellow" eventId="{alloy_id}">
<Label id="eventName" text="{name}" eventId="{alloy_id}" />
<View id="eventTypeContainer" class="iconedLabelBig">
<ImageView image="{icon}" class="iconBig" />
<Label id="eventType" text="{type}" eventId="{alloy_id}" />
</View>
</View>
</View>
</TableViewRow>
</TableView>
</Window>
</Alloy>
它工作正常,但在Android上的表現實在是太差了,所以我想用ListView而不是TableView重寫相同的列表。 這就是我想出了:
<Alloy>
<Collection src="featuredEvents"/>
<Window id="win" class="container" navBarHidden="true" exitOnClose="true" onOpen="showIndicator">
<View id="navView"></View>
<ActivityIndicator id="activityIndicator" message="L('loading')" />
<ListView id="featuredEvents" dataCollection="featuredEvents" dataFilter="filterEvents" opacity="0" class="list">
<ListSection eventId="{alloy_id}" onClick="showEvent">
<ListItem class="event-wrapper">
<ImageView image="{img}" eventId="{alloy_id}" defaultImage="/img/loading.jpg"/>
<View class="eventImageOverlayYellow" eventId="{alloy_id}">
<Label id="eventName" text="{name}" eventId="{alloy_id}" />
<View id="eventTypeContainer" class="iconedLabelBig">
<ImageView image="{icon}" class="iconBig" />
<Label id="eventType" text="{type}" eventId="{alloy_id}" />
</View>
</View>
</ListItem>
</ListSection>
</ListView>
</Window>
</Alloy>
我控制器index.js:
function showIndicator(e){}
$.win.open();
當我運行它,我得到了以下錯誤:
Location:
alloy/controllers/index.js
Message:
Uncaught typeError: cannot read property '_transform' of null
Source:
title:"undefined" != typeof $model__transform["name"] ? $model._
-Is有一個用於合金數據收集的ListView示例?
-任何想法是什麼意思?