[TIMOB-691] Android: updateRow doesn't work if the table row has headers
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-07-30T10:25:42.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | api |
Reporter | Mark Peace |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:34:35.000+0000 |
Updated | 2017-03-22T21:27:40.000+0000 |
Description
When a tableview (in android 2.1) has headers in its rows, updateRow fails with an array out of bounds error (the same table updates fine when the headers are removed).
As in the following code:
var LogFind = Ti.UI.createTableView({
data: [
{ header: 'Details', title: 'Tag', hasChild: true, color: 'black', url: 'LogFind/LogFind.js' },
{ title: 'Comment', hasChild:true, color: 'black', url: 'LogFind/LogFind.js' },
{ header: 'Images', title: 'Picture 1', hasChild:true, color: 'black', url: 'LogFind/LogFind.js' },
{ title: 'Picture 2', hasChild: true, color: 'black', url: 'LogFind/LogFind.js' },
{ title: 'Picture 3', hasChild: true, color: 'black', url: 'LogFind/LogFind.js' },
{ name:'GPS', header: 'Commands', title: 'GPS', color: 'black', url: 'LogFind/LogFind.js' },
{ title: 'Submit', hasChild: true, color: 'black', url: 'LogFind/LogFind.js' }
]
})
LogFind.addEventListener ('click', function(e) {
alert((e.index))
})
var win = Titanium.UI.createWindow ({
backgroundColor: 'white'
});
win.add(LogFind);
win.open();
LogFind.updateRow(5, { title: 'Getting GPS...' });
The fix for [TIMOB-9072] corrects this. I ran the test code included in this ticket wit the fix for [TIMOB-9072] and it works as expected.
Closing as duplicate with regards to the information provided elsewhere in this ticket.