What I am trying to say is that while I am setting up selectedIndex three times the updateDisplayList event fires only once.
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > I'm sorry, but this didn't make any sense. I don't see the code that > broke in your exaple. > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of markgoldin_2000 > Sent: Tuesday, August 26, 2008 9:09 AM > To: [email protected] > Subject: [flexcoders] selectedIndex and updateDisplayList > > > > I have a DG with three rows. I am setting up a dataProvider for it > like this: > override public function set dataProvider(value:Object):void > { > super.dataProvider = value; > if (dataProvider != null && dataProvider.length != 0) > { > var cursor:IViewCursor = (dataProvider as > ICollectionView).createCursor(); > var recNum:int = 0; > while (!cursor.afterLast) > { > var obj:Object = cursor.current; > if (obj["somecondition"] == 1) // Show plan > { > selectedIndex = recNum; > trace(selectedIndex); > } > recNum++; > cursor.moveNext(); > } > } > } > after that in Console I have: > 0 > 1 > 2 > 0 > then in updateDisplayList I need to highlight cells based on data > condition: > if (grid1.isItemSelected(data)) > { > storeBackgroundCell = getStyle("backgroundColor"); > if (g == null) > { > g = graphics; > } > trace("updateDisplayList"); > .... > Program execution is suspended at trace(data["plan" + blockNum]); > and the Console still did not show any more records which means that > while I am setting up selectedIndex in set dataProvider for each row > the updateDisplayList is executed for the last one only. > Am I doing something wrong or it is how it works? > > Thanks >

