Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24125] Windows: Calling insertRowBefore with an existing row causes application to freeze

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-02-06T07:59:20.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.1.0
ComponentsWindows
Labelsqe-6.0.0
ReporterEwan Harris
AssigneeKota Iguchi
Created2016-11-09T14:20:01.000+0000
Updated2017-02-06T22:14:02.000+0000

Description

Description

When calling insertRowBefore with a row that has been taken from the table, not a dictionary or a newly created row, the application appears to freeze
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) {
    var row = table.data[e.index];
    Ti.API.info('index');
    Ti.API.info(e.index);
    Ti.API.info(row.title);
    table.insertRowBefore(0, row);
});
_window.open();

Steps to reproduce

Add the code above to an existing app.js

Build for Windows Platform

Tap a row

Actual result

Application appears to freeze on the row click

Expected result

A duplicate of the row clicked should be added to the top of the tableview

Attachments

FileDateSize
6.1.0.v20170206114448.PNG2017-02-06T22:05:34.000+000019637
Before.PNG2017-02-06T22:12:23.000+000013908
list.png2017-01-30T11:52:12.000+00002333

Comments

  1. Kota Iguchi 2017-02-02

    https://github.com/appcelerator/titanium_mobile_windows/pull/939
  2. Samir Mohammed 2017-02-06

    Verified fixed with the test code provided in the description, was able to verify that a new row is added to the top of the tableview when an existing row is clicked. The screenshot below shows that rows are added to the top of the table view when clicking on a row. (Shows before and after clicking on random rows) !Before.PNG|thumbnail! !6.1.0.v20170206114448.PNG|thumbnail! *Environment*
       Phone : Lumia 640 LTE (RM-1073)
       Operating System:
       Name                        = Microsoft Windows 10 Pro
       Version                     = 10.0.14393
       Architecture                = 32bit
       

    CPUs = 4

    Memory = 17034395648 Node.js: Node.js Version = 4.6.0 npm Version = 2.15.9 Titanium SDK: SDK Version = 6.1.0.v20170206114448

JSON Source