poniedziałek, 14 czerwca 2010

Flex: Important difference between TileList and Repeater

Let's assume we need to do some custom stuff after sending data, from data provider, to either TileList or Repeater items.

First step is to override commitProperties function in class that will represent item renderers in both cases.

All data passed to the item renderer by its parent object (TileList/Renderer) should be available during the execution of this function (and not only then) in the data variable. The difference is that Renderer does not put that data there automatically. God knows why.

To make it work exactly like TileList, or any other list for that matter, simply preceed all instructions in commitProperties by statement shown on following example:

override protected function commitProperties():void
{
   data = getRepeaterItem();
}

Brak komentarzy:

Prześlij komentarz