Description
When calling tableview.data/tableView.getData() on Windows it will return tableviewrows however on both iOS and Android it will always seem to return a tableviewsection regardless of if a tableviewsection has been added.
var _window = Ti.UI.createWindow();
var table = Ti.UI.createTableView({
top: 0,
bottom: 0
});
var tableData = [];
for (var i = 0; i < 10; i++) {
tableData.push(Ti.UI.createTableViewRow({
title: "Row " + (i + 1)
}));
}
table.setData(tableData);
_window.add(table);
table.addEventListener("click", function (e) {
alert(table.data[0].rows[e.index].title);
});
_window.open();
I'm unsure which is the preferential behaviour
Steps to reproduce
Add the above code to an existing app.js and build for windows platform
Click update row
Observe logs
Actual result
The value returned is multiple tableviewrows
Expected result
Unsure, but for parity with other platforms it should be a tableviewsection
As far as I can see from the source,
data
always returnsTableViewSection[]
on [iOS](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUITableViewProxy.m#L782) and [Android](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewProxy.java#L697). The reason why type ofTi.UI.TableView.data
is marked bothTitanium.UI.TableViewRow[]/Titanium.UI.TableViewSection[]
in [API doc](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-property-data) I think is that it _accepts_Titanium.UI.TableViewRow[]
as well asTitanium.UI.TableViewSection[]
whereasdata
always _returns_Titanium.UI.TableViewSection[]
. So Windows implementation was wrong in this case.master: https://github.com/appcelerator/titanium_mobile_windows/pull/940
[~kota] with the code provided in the description and with the code in https://github.com/appcelerator/titanium_mobile_windows/pull/940 I get the following error message on the windows mobile. !Screen Shot 2017-02-07 at 1.31.42 PM.png|thumbnail! *Environment*
Verified fix with the test code provided in the description. Was able to see an alert with the row number which had been clicked. !6.1.0.v20170209111025 1.PNG|thumbnail! *Environment*