[TIMOB-8055] MobileWeb: TableViewRow - Creating a table view then removing its data doesn't update the table view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-17T16:22:44.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | MobileWeb |
Labels | "qe-mw020912" |
Reporter | Michael Pettiford |
Assignee | Chris Barber |
Created | 2012-03-16T11:51:53.000+0000 |
Updated | 2017-03-03T23:59:02.000+0000 |
Description
Steps to reproduce:
1. Create a default app and change the app.js code to the following:
var _window = Titanium.UI.createWindow({
title : 'test',
backgroundColor : 'white'
});
var myTableView = Ti.UI.createTableView();
var row = Ti.UI.createTableViewRow({
height : 80,
backgroundColor : '#c00',
});
myTableView.appendRow(row);
_window.add(myTableView);
_window.addEventListener('open', function() {
setTimeout(function() {
Ti.API.debug(JSON.stringify(myTableView));
var tableRows = myTableView.data[0].rows;
Ti.API.debug(JSON.stringify(tableRows));
tableRows.pop();
myTableView.data = tableRows;
}, 2000);
// two seconds after the window opens, remove the red row
});
_window.open();
2. Run the app
Actual result:
The table view still contains the row being removed
Expected result:
The table view updates with the new (empty) data
Note: you can't stringify myTableView because you create what's called a circular reference. TableView refers to TableViewSection, which refers to TableView, etc.
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1723
Closing ticket as MobileWeb is no longer supported.