[TIMOB-12620] Android: TableView.sections property not supported
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-06T22:09:48.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 05 |
Components | Android |
Labels | parity, qe-testadded, triage |
Reporter | Arthur Evans |
Assignee | Arthur Evans |
Created | 2013-02-07T19:42:08.000+0000 |
Updated | 2016-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);
PR Ready: https://github.com/appcelerator/titanium_mobile/pull/3849 sections was already supported, but as a read-only property.
PR Ready: https://github.com/appcelerator/titanium_mobile/pull/3849
Tested with: SDK: 3.1.0.v20130312015656 Studio: 3.1.0.201303091040 Device: Android emulator OS: OSX 10.7.5 works as expected