[TIMOB-2146] Android: setData not always updating
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:13.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Bill Dawson |
Created | 2011-04-15T03:11:49.000+0000 |
Updated | 2011-04-17T01:58:13.000+0000 |
Description
See http://developer.appcelerator.com/helpdesk/view/50231">Helpdesk 50231 for example.
Not marking as a regression yet. Bill if you think it is, please tag it that way.
Comments
- Bill Dawson 2011-04-15
Workaround is to set to empty array then set to real data.
- Bill Dawson 2011-04-15
confirmed this is already fixed in 1.5. My test:
var win = Ti.UI.currentWindow; var data = []; for (var i = 0; i < 8; i++) { data.push( Ti.UI.createTableViewRow({ title: 'Row ' + (i + 1), color: 'black', backgroundColor: 'yellow'}) ); } var tv = Ti.UI.createTableView({ top: 40, data: data }); win.add(tv); var btn = Ti.UI.createButton({ title: 'setData()', top: 0, left: 0, width: 150, height: 35 }); btn.addEventListener('click', function() { data.push( Ti.UI.createTableViewRow({ title: 'Another row', color: 'black', backgroundColor: 'white'})); tv.setData(data); }); win.add(btn);
- Bill Dawson 2011-04-15
(from [536e81c80f9fef69c2681fde27f74b029b75a79c]) [#2146] Add unit test to be sure setData successfully replaces existing data rows. https://github.com/appcelerator/titanium_mobile/commit/536e81c80f9fef69c2681fde27f74b029b75a79c"> https://github.com/appcelerator/titanium_mobile/commit/536e81c80f9f...