Flex 4: ExcludeSelectionList

This component was in part inspired by some work Steven Shongrunden had done and a task that we had on a job.

We didn’t want to have to change our data objects to hold a hard coded value to check whether the item should be selectable or not as in Steve’s version so I came up with this.

There’s 3 ways you can specify to exclude an item from being is selectable.

  • You can add a type to exclude using excludeType, or a lost of types to exclude using excludeTypes.
  • You can add a index to exclude using excludeIndex, or a list of indices to exclude using excludeIndices.
  • You can specify a function that returns true or false on whether the item should be selectable using excludeFunction. The function takes 2 paremeters, the first an int which is the index of the item, and the second an Object which is the item itself.
  • The example below shows each of these being used, but you could also use a combination of the 3 methods above to exclude items.

    (right click for source).

    The source can be downloaded from our Google Code repository, the following class has been added.

  • ws.tink.spark.controls.ExcludeSelectionList
  • 3 Responses to “Flex 4: ExcludeSelectionList”

    1. [...] more: http://www.tink.ws/blog/flex-4-excludeselectionlist-2/ This thing was constructed by Filippo Lughi. You can follow comments through the RSS 2.0 feed. You [...]

    Leave a Reply