You are reading 13.3.1. See this page in 13.4.1.
Titanium.UI.ListSection
Extends Titanium.Proxy
A list section is a container within a list view used to organize list items.
Use the Titanium.UI.createListSection method or <ListSection> Alloy element to create a ListSection.
List sections are used to manipulate and organize list items contained within it. For examples of using list sections, see the examples in Titanium.UI.ListView and Titanium.UI.ListItem.
Examples
Alloy XML Markup
ListSection is supported by Alloy 1.2.0 and later.
HeaderView and FooterView are supported on Alloy 1.3.0 and later.
<Alloy>
<Window fullscreen="true">
<ListView>
<ListSection>
<!-- Sets ListSection's headerView property -->
<HeaderView>
<View backgroundColor="#DDD" height="Ti.UI.SIZE">
<Label>Fruits</Label>
</View>>
</HeaderView>
<ListItem title="Apple" />
<ListItem title="Orange" />
<ListItem title="Pear" />
<!-- Sets ListSection's footerView property -->
<FooterView>
<View backgroundColor="#DDD" height="Ti.UI.SIZE">
<Label>3 items</Label>
</View>
</FooterView>
</ListSection>
</ListView>
</Window>
</Alloy>
Properties 9
Inherited from Titanium.Proxy
The name of the API that this proxy corresponds to.
Returns the item count of the section, also incorporating the search filter if active.
footerTitle
StringTitle of this section footer.
Using this property and footerView together is not supported. Use one or the other.
View to use for this section footer.
Using this property and footerTitle together is not supported. Use one or the other.
In Alloy you can specify this property with a <FooterView> child element of a <ListSection>
element (see Examples).
headerTitle
StringTitle of this section header.
Using this property and headerView together is not supported. Use one or the other.
View to use for this section header.
Using this property and headerTitle together is not supported. Use one or the other.
In Alloy you can specify this property with a <HeaderView> child element of a <ListSection>
element (see Examples).
Returns the item count of the section.
items
Array<ListDataItem>Items of this list section.
Inherited from Titanium.Proxy
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
Methods 8
Appends the data entries to the end of the list section.
On iOS, the list item(s) can be inserted with an animation by specifying the animation parameter.
| Parameters | Type | Description |
|---|---|---|
| dataItems | Array<ListDataItem> | List items to add. |
| animation? | ListViewAnimationProperties | Animation properties. (iOS only.) |
applyProperties
since 3.0.0Inherited from Titanium.Proxy
Applies the properties to the proxy.
| Parameters | Type | Description |
|---|---|---|
| props | Dictionary | A dictionary of properties to apply. |
Removes count entries from the list section at the specified index.
On iOS, the list item(s) can be removed with an animation by specifying the animation parameter.
| Parameters | Type | Description |
|---|---|---|
| itemIndex | Number | Index of where to remove items. |
| count | Number | Number of items to remove. |
| animation? | ListViewAnimationProperties | Animation properties. (iOS only.) |
Returns the item entry from the list view at the specified index.
| Parameters | Type | Description |
|---|---|---|
| itemIndex | Number | Index of where to retrieve an item. |
Inserts data entries to the list section at the specified index.
On iOS, the list item(s) can be inserted with an animation by specifying the animation parameter.
| Parameters | Type | Description |
|---|---|---|
| itemIndex | Number | Index of where to insert the items. |
| dataItems | Array<ListDataItem> | List items to insert. |
| animation? | ListViewAnimationProperties | Animation properties. (iOS only.) |
Removes count entries from the list section at the specified index, then inserts data entries to the list section at the same index.
On iOS, the list item(s) can be replaced with an animation by specifying the animation parameter.
| Parameters | Type | Description |
|---|---|---|
| index | Number | Index of where to remove then insert items. |
| count | Number | Number of list items to remove. |
| dataItems | Array<ListDataItem> | List items to insert. |
| animation? | ListViewAnimationProperties | Animation properties. (iOS only.) |
Sets the data entries in the list section.
On iOS, the list item(s) can be inserted with an animation by specifying the animation parameter.
| Parameters | Type | Description |
|---|---|---|
| dataItems | Array<ListDataItem> | List items to set. |
| animation? | ListViewAnimationProperties | Animation properties. (iOS only.) |
Updates an item at the specified index.
On iOS, the list item can be updated with an animation by specifying the animation parameter.
| Parameters | Type | Description |
|---|---|---|
| index | Number | Index of where to update the item. |
| dataItem | ListDataItem | List item to update. |
| animation? | ListViewAnimationProperties | Animation properties. (iOS only.) |