【发布时间】:2016-06-17 12:03:56
【问题描述】:
我只是想知道热到只显示最后三个插入钛的系列?
<View dataCollection="competence" dataFilter="filterFunction" height="Ti.UI.SIZE" layout="vertical" backgroundColor="gray" >
<Label backgroundColor='red' height="Ti.UI.SIZE" text="{date_debut}"/>
<Label backgroundColor='white' height="Ti.UI.SIZE" text="{date_fin}"/>
</View>
这个按 'ASC' 从 id 顺序显示集合,我的目的只是显示最后三个元素。
我尝试使用 dataFilter :
function filterFunction(collection){
// Underscore last method not working
return _.last(collection, 3);
}
你能帮帮我吗?谢谢。
【问题讨论】:
标签: titanium appcelerator titanium-mobile titanium-alloy appcelerator-titanium