Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25936] iOS: TableView: Appending row immediately after a section appends them before the section

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-04-06T21:13:15.000+0000
Affected Version/sRelease 7.1.0
Fix Version/sRelease 7.1.1
ComponentsiOS
Labelsmainthread, qe-7.1.0
ReporterEric Wieber
AssigneeHans Knöchel
Created2018-04-05T18:20:53.000+0000
Updated2018-04-06T22:37:47.000+0000

Description

In a TableView, when appending a row immediately after appending a section, the elements appear in the reverse order (row and then section). *Steps to reproduce issue*: 1. Create a classic app with the below code 2. Run the app *Expected Results*: Each section has 3 rows under it *Actual Results*: All of the rows appear first, then the sections *Notes*: In the example, you can click on the window to add another section and row that also appear in reverse order.
var win = Ti.UI.createWindow({ backgroundColor: "#f00" });
var table = Ti.UI.createTableView();

for (var i = 0; i < 2; ++i) {
	table.appendSection(Ti.UI.createTableViewSection({ headerTitle: "Header " + i, className: "Header" }));
    for (var j = 0; j < 3; j++) {
    	table.appendRow(Ti.UI.createTableViewRow({ title: "Row " + j, className: "Row" }));
    }
}

win.addEventListener("click", function() {
	table.appendSection(Ti.UI.createTableViewSection({ headerTitle: "Title", className: "Header" }));
	table.appendRow(Ti.UI.createTableViewRow({ title: "Row ", className: "Row" }));
});
        
win.add(table);
win.open();

Comments

  1. Hans Knöchel 2018-04-06

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9986 PR (7_1_X): https://github.com/appcelerator/titanium_mobile/pull/9987 Unit-test part of the PR, test-case above.
  2. Eric Wieber 2018-04-06

    FR Passed. Sections and rows are appended in the correct order. Tested using the provided code as well as modifications to the project to append in different ways and/or orders.
  3. Eric Wieber 2018-04-06

    Verified changes are in SDK builds 7.1.1.v20180406141533 & 7.2.0.v20180406141822

JSON Source