Titanium JIRA Archive
Alloy (ALOY)

[ALOY-608] Support ListView's ItemTemplate in markup

GitHub Issuen/a
TypeSub-task
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2013-04-09T22:02:27.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 08
ComponentsXML
Labelsnotable
ReporterTony Lukasavage
AssigneeUnknown
Created2013-04-05T16:12:30.000+0000
Updated2018-03-07T22:25:37.000+0000

Description

Enable ItemTemplates to be defined and used in ListView markup. Something like this (subject to change):
<Alloy>
	<Tab title="templates">
		<Window title="templates">
			<ListView id="list" defaultItemTemplate="template1">
				<Templates>
					<ItemTemplate name="template1" height="100">
						<ImageView bindId="image" left="15" top="6" bottom="6"/>
						<Label bindId="label" left="100" right="10"/>
					</ItemTemplate>
					<ItemTemplate name="template2" height="100">
						<Label bindId="label"/>
					</ItemTemplate>
				</Templates>

				<ListSection>
					<ListItem image:image="appc.png" label:text="this is some text"/>
					<ListItem image:image="appc.png" label:text="here we go again"/>
					<ListItem template="template2" label:text="here is template2" label:textAlign="center"/>
				</ListSection>
			</ListView>
		</Window>
	</Tab>
</Alloy>

Comments

  1. Tony Lukasavage 2013-04-09

    ItemTemplates are working as described in the markup. Sample code can be found in: https://github.com/appcelerator/alloy/tree/master/test/apps/ui/listview
  2. Federico Casali 2013-07-16

    Verified as working. Environment: Titanium SDK 3.1.2.v20130710144553 Appcelerator Studio 3.1.2.201307101037 Alloy 1.2.0

JSON Source