[ALOY-394] Model-view binding on Views using collections
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2012-12-11T23:47:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 0.3.4, 2012 Sprint 25 |
Components | Runtime, XML |
Labels | GA-candidate, notable |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2012-11-15T18:48:33.000+0000 |
Updated | 2018-03-07T22:25:58.000+0000 |
Description
We need to be able to use model-view binding on generic view components just as we do on TableViews in ALOY-104. This will allow views in Alloy do render a repeated series of UI components based on a Collection.
<Collection src="myModel"/>
<View layout="horizontal" dataCollection="myModel">
<ImageView image="{image}"/>
</View>
We also need to determine if all Titanium views should be able to do this or if we should reserve this for the basic ones like Window, View, etc...
collection binding now works on arbitrary titanium views (Ti.UI.View, Ti.UI.ScrollView, etc...), just as with TableViews. A full test app showing how a Ti.UI.ScrollView can be used to contain collection-generated UI components can be found here: https://github.com/appcelerator/alloy/tree/master/test/apps/models/journal