Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16083] ListView: Allow `selectItem` to be called before layout is finished

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsTiAPI
Labelsn/a
ReporterFokke Zandbergen
AssigneeUnknown
Created2013-12-18T12:23:43.000+0000
Updated2018-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.

Comments

  1. Ritu Agrawal 2013-12-26

    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.
  2. Fokke Zandbergen 2013-12-26

    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.
  3. Ritu Agrawal 2013-12-26

    Makes sense. Moving this enhancement request to engineering for further evaluation and prioritization.

JSON Source