Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12620] Android: TableView.sections property not supported

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-06T22:09:48.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.1.0, 2013 Sprint 05
ComponentsAndroid
Labelsparity, qe-testadded, triage
ReporterArthur Evans
AssigneeArthur Evans
Created2013-02-07T19:42:08.000+0000
Updated2016-02-25T21:57:33.000+0000

Description

Using the test case from the linked bug I noticed that table.sections = [mySection]; doesn't work on Android. The doc says it's supported on all platforms:

var win = Ti.UI.createWindow({
	backgroundColor:"#eee"
});
win.open();

var table = Ti.UI.createTableView();
var section = Ti.UI.createTableViewSection();
section.headerView = (function() {
	var view = Ti.UI.createView();
	var label = Ti.UI.createLabel({ text: "Some Section" });
	view.add(label);

	return view;
})();

var row = Ti.UI.createTableViewRow({
	title: "Row"
});

section.add(row);

// DOESN'T WORK
//table.sections = [section];

// THIS WORKS
//table.appendSection(section);

// THIS WORKS
//table.setData([section]);

table.addEventListener("click", function(event) {
	alert("TableView Clicked");
	Ti.API.debug(event.row);
});

win.add(table);

Comments

  1. Arthur Evans 2013-02-07

    PR Ready: https://github.com/appcelerator/titanium_mobile/pull/3849 sections was already supported, but as a read-only property.
  2. Arthur Evans 2013-02-12

    PR Ready: https://github.com/appcelerator/titanium_mobile/pull/3849
  3. Anshu Mittal 2013-03-12

    Tested with: SDK: 3.1.0.v20130312015656 Studio: 3.1.0.201303091040 Device: Android emulator OS: OSX 10.7.5 works as expected

JSON Source