0 Replies Latest reply on Aug 16, 2007 4:12 PM by cakebin

    Forcing custom itemRenderer to updateDisplayList?

    cakebin
      Hi, I'm new to flex, and was having some trouble.

      In my project, I have a DataGrid, and a BarChart->BarSeries. The DataGrid and the BarSeries share the same DataProvider. I've made a custom itemRenderer, so that I can click on Bars in the BarSeries and have them be highlighted in black. This is done by having the itemRenderer listen for a CLICK event, changing a variable that stores what color I want, then calling invalidateDisplayList() to have updateDisplayList update the display.

      Since DataGrid and BarSeries share the same DataProvider, elements in the DataGrid match up with elements in the BarSeries. Therefore, I would like to be able to have a user click on an item in the DataGrid, and have the associated bar in the BarSeries chart become highlighted. However, I can't find a way to get the itemRenderer to call updateDisplayList from outside of the itemRenderer itself. I thought that calling invalidateDisplayList() using the BarChart's id or the BarSeries id would force the itemRenderer for the BarSeries to call updateDisplayList() and update itself, but by using the debug feature, I have found that it does not do this. Does anyone have any advice for how I would be able to click on a DataGrid item and have it highlight the corresponding item in the BarChart?

      Thanks!