[TIMOB-2724] iOS: selectRow fails in TableViews
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-11T16:31:56.000+0000 |
Affected Version/s | Release 1.5.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-10 API |
Components | iOS |
Labels | SupportTeam, api, module_tableview, qe-testadded |
Reporter | Ronnie Swietek |
Assignee | Vishal Duggal |
Created | 2011-04-15T03:27:50.000+0000 |
Updated | 2012-07-10T12:52:29.000+0000 |
Description
According to the API:
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableView-object">
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI....
selectRow - programmatically select a row
I've tested this on the iphone and ipad and they both fail to select a row. Attached below is a quick example.
edit:
It seems this bug happens when there are rows that go off the
device screen. If I do like 10 or 11 rows it works fine. 12+ it
breaks (on iphone)
On the iPad obviously you can fit more rows so this number will be higher.
Attachments
File | Date | Size |
---|---|---|
cm-movie-1.mov | 2011-04-15T03:27:51.000+0000 | 5222671 |
selectrow_test.zip | 2011-04-15T03:27:53.000+0000 | 1815900 |
attached a new dumbed down version
Titanium 1.5.1 and iphone sdk 4.2
am I doing something wrong when posting bugs? Mine never seem to get assigned to anyone. Here is a thread of other people claiming its a bug
http://developer.appcelerator.com/question/96361/selectrow-on-a-tableview"> http://developer.appcelerator.com/question/96361/selectrow-on-a-tab...
Can we get some attention on this? TableView is a pretty common UI element that should be at least medium priority.
I found that selectRow works in 1.5.0 but not 1.5.1
ok I lied. I've come to this conclusion
It seems this bug happens when there are rows that go off the device screen. If I do like 10 or 11 rows it works fine. 12+ it breaks (on iphone)
On the iPad obviously you can fit more rows so this number will be higher.
I've noticed the same problem. I can reproduce the problem with only 5 rows when the height of the rows are set to 100px. I agree with Ronnie that when the rows go off the device screen the selectRow method will not work.
I have also noticed that selecting a single row causes another row to automatically be selected. For instance, if I click the first row and select it, and then scroll down another row was automatically selected.
Is there a workaround for this?
Why wasn't a bug like this fixed in the 1.6 release?? I screen recorded a test app I made and you can see the list is lengthy...about 30 rows..If I start scrolling, random rows start to get selected. Note, I have no clicked on any rows..uhmmm??
Don I am selecting you as the "who is responsible". I've seen you get many things fixed around here..well and I am just not familiar with anyone else.
Thanks for addressing this Don, but low priority? The list is pretty unusable at this point. Also what does TBS stand for?
I've moved it over to the iOS lead to classify. It's not my position to classify the priority of his items. TBS means "To Be Scheduled"
I've found a solution to this which is described here:
http://developer.appcelerator.com/question/96361/selectrow-on-a-tableview"> http://developer.appcelerator.com/question/96361/selectrow-on-a-tab...
In essence, TiUITableView delays setting the selection of the table view until the last cell is display (for some reason). However, if the last cell is not visible then it won't trigger the selection.
My work around is to remove the check for the last row, so it will now trigger when the first cell is displayed. This works fine because it will only trigger once due to the initiallyDisplayed variable being set to YES within the if statement.
In TiUITableView.m change tableView:willDisplayCell:
if (initiallyDisplayed==NO && [indexPath section]==[sections count]-1 && [indexPath row]==[section rowCount]-1)
to:
if (initiallyDisplayed==NO)
Bump, can we please get this bug prioritized? I am waiting on this fix to release an iPad app. Also waiting on a related fix for tableView.scrollToIndex() to work on iPad.
Bump. Bump. I too am waiting on a fix for this. Any ETA on a fix ?
I'm being plagued with this bug too. Here is a clear screencast of the issue: http://screencast.com/t/xXHuMoXc And another test-case here: https://gist.github.com/1329382 Any ETA?
Bump. The .selectRow() method does not work, it would be great to get some kind of ETA of when it will. Thanks.
Test Case
Closing issue Tested with Ti Studio build 2.1.0.201206200844 Ti Mobile SDK 2.1.0.v20120619172256 hash rd3a84b13 OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown