I have a view in Titanium Alloy which loops through a list of videos in a collection, like so:
<View dataCollection="videos" dataFilter="recentlyAddedFilter">
<ImageView image="{img}" width="200">
<Label text="{title}"></Label>
</ImageView>
</View>
And I have a filter function called recentlyAddedFilter
, defined in my controller like so:
function recentlyAddedFilter(collection) {
return collection.where({title:'A title'});
}
I'm going to create multiple versions of this view
component, so I would like the filter function to be able to access each individual component that it is applied to, just like I can use the collection
inside the filter function. So it would be great if I could do something like this:
function recentlyAddedFilter(collection) {
theComponent.width = "200dp"; // change property on component that calls this function
return collection.where({title:'A title'});
}
Is there a way that I can do this?