Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8055] MobileWeb: TableViewRow - Creating a table view then removing its data doesn't update the table view

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-17T16:22:44.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsMobileWeb
Labels"qe-mw020912"
ReporterMichael Pettiford
AssigneeChris Barber
Created2012-03-16T11:51:53.000+0000
Updated2017-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

Comments

  1. Bryan Hughes 2012-03-17

    Note: you can't stringify myTableView because you create what's called a circular reference. TableView refers to TableViewSection, which refers to TableView, etc.
  2. Bryan Hughes 2012-03-17

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1723
  3. Lee Morris 2017-03-03

    Closing ticket as MobileWeb is no longer supported.

JSON Source