Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16266] Android: ListView.sections is undefined

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-07T18:46:03.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2014 Sprint 05, 2014 Sprint 05 API, Release 3.3.0
ComponentsAndroid
Labelsandroid, listsection, listview, qe-testadded, section
ReporterPier Paolo Ramon
AssigneeSunila
Created2014-01-20T21:25:44.000+0000
Updated2014-07-23T10:12:55.000+0000

Description

There's no way to access a ListView sections property. It will always returns undefined.
var window = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});

var listView = Ti.UI.createListView({ });

window.add(listView);

var section = Ti.UI.createListSection({
	items: [
		{
			properties: {
				title: 'Hallo'
			}
		}
	]
});

listView.appendSection(section);

function test() {
	Ti.API.error(" >> " + listView.sections);
}

test();

setTimeout(test, 1e3);

Comments

  1. Ritu Agrawal 2014-01-21

    Moving this ticket to engineering as I can reproduce this issue with the provided test case.
  2. Pier Paolo Ramon 2014-01-21

    Actually, I discovered it’s simply not implemented :\
  3. Ritu Agrawal 2014-01-23

    ListView.sections property is not marked as iOS only property so we may consider this ticket either as a Doc bug or as an Android feature request.
  4. Sunila 2014-02-02

    Exposed sections as a property and method. https://github.com/appcelerator/titanium_mobile/pull/5306
  5. Paras Mishra 2014-04-18

    ListView.sections is returning ListSection Object, hence closing the issue. Verified the issue on: Tested on: Device : Google Nexus 5, Android Version: 4.4.2 SDK: 3.3.0.v20140417173316 CLI version : 3.2.3-alpha3 OS : MAC OSX 10.9.2 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.3.201404151910 titanium-code-processor: 1.1.1-alpha XCode : 5.1.1

JSON Source