[TIMOB-1389] iOS: Add ability to dynamically add rows to TableView sections
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-05-06T08:42:34.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2013 Sprint 09 |
Components | iOS |
Labels | api, review |
Reporter | Matthew Lieder |
Assignee | Shameer Jan |
Created | 2011-04-15T02:51:08.000+0000 |
Updated | 2017-03-21T22:03:18.000+0000 |
Description
It's quite easy to add rows to an existing TableView (tableview.appendRow(row)), however it just adds rows to the absolute bottom of the table and not to the bottom of the section. I can use insertRowBefore/After to add rows to existing sections, but it obviously doesn't work if all the rows have been deleted from the section. Closest I've gotten to finding a solution is section.add(row), but that doesn't update the UI and even when I do force the UI to update (by changing an attribute on the section object) weird UI glitches appear.
Basically what I need is something like TableView.appendRowToSection(row, section), or TableViewSection.add(row) to be fixed to work when the tableview's already been rendered.
Use case is toggling display of rows inside a section; I'm wanting the user to be able to collapse/expand sections just by tapping the section header.
Helpdesk reference: http://developer.appcelerator.com/helpdesk/view/31021">http://developer.appcelerator.com/helpdesk/view/31021
I've also attached some code that demonstrates what I'm attempting and the problems I'm experiencing. It should drop right into the Kitchen Sink app. To reproduce the section.add UI glitches, collapsing and then expand (by clicking it) the bottom header, then the middle header, then the top header. Notice how the lower headers seem to reproduce, with one staying in place and the other moving up.
Attachments
File | Date | Size |
---|---|---|
table_view_collapsing_headers.js | 2011-04-15T02:51:08.000+0000 | 3928 |