[TIMOB-1029] Ability to instantly clear all rows from a tableview
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T02:41:55.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Matthew Lieder |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:41:55.000+0000 |
Updated | 2017-03-09T21:23:26.000+0000 |
Description
I'm using a TableView to show a list of settings in my app, similar to Settings in the iPhone OS, and the easiest way to update the table after a setting has been changed is to re-add all the rows. The problem is, when I remove the rows using setData([]), it takes up half a second or so showing an unnecessary animation of all the rows being removed! When all I want is for the data to seamlessly be updated, that's an unacceptable user experience. It has to be really simple to get rid of that animation, but from my searching and experimenting so far it seems like it actually surprisingly might not be possible with the current state of the API (see http://developer.appcelerator.com/question/1271/how-to-set-data-to-a-table-view-without-animation"> http://developer.appcelerator.com/question/1271/how-to-set-data-to-... and the "invalid" issue 815).
Could this please be added ASAP?
calling setData without a secondary parameter will cause the data to be loaded with animation by default.
you have two options:
1/ Call tableview.data = []
this is w/o animation by default.
2/ Call tableview.setData(data,{animationStyle:Titanium.UI.iPhone.RowAnimationStyle.NONE})
this will turn off animation too
I updated KS to add a test case to show this explicitly.
Also, in 1.4, you will be able to just pass a null too. For now, you'll have to pass empty array.
Thanks for your help; my problem turned out to be that one of my apps still was using the 1.2.0 API :(. Works great now!
Closing ticket as invalid.