[TIMOB-16083] ListView: Allow `selectItem` to be called before layout is finished
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | TiAPI |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Unknown |
Created | 2013-12-18T12:23:43.000+0000 |
Updated | 2018-02-28T20:03:19.000+0000 |
Description
If I call
selectItem
directly after adding a bunch of sections and items it won't work. I have to wait for the postlayout
event.
It would be nice if this was handled internally.
I am curious of the use case when it is advantageous to call selectItem method before the postlayout event as opposed to after the postlayout event. I would appreciate if you can explain a bit more.
It is simply a matter of convenience really. When I fill a ListView I and want to have a row pre-selected its inconvenient to add an eventlistener to wait for the postlayout event, specially because this event fires lots of time so I can't use a quick anonymous function but have to create a separate function and remove the eventlistener from as soon as it is called. It would make the code cleaner if I can call the method anytime and the API would just check if a row was preselected after finishing filling the ListView.
Makes sense. Moving this enhancement request to engineering for further evaluation and prioritization.