ItemRenderer for TreeColumn on AdvancedDataGrid in Flex?

Here's what I did to accomplish this: Create a class that extends AdvancedDataGridGroupItemRenderer In the new class override updateDisplayList and do what you need to do Assign the new class to the groupItemRenderer property of the AdvancedDataGrid Here's what your new class might look like public class CustomGroupRenderer extends AdvancedDataGridGroupItemRenderer { override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super. UpdateDisplayList(unscaledWidth, unscaledHeight); var listData:AdvancedDataGridListData = listData as AdvancedDataGridListData; var advancedDataGrid:AdvancedDataGridDataGrid = listData. Owner as AdvancedDataGrid; var cellBackgroundColor:uint = 0xFF0000; var g:Graphics = graphics; g.clear(); if (!advancedDataGrid.

IsItemSelected(data) &&! AdvancedDataGrid. IsItemBeginFill(cellBackgroundColor); g.

DrawRect(0, 0, unscaledWidth, unscaledHeight); g.endFill(); } } } And then assign this class to the groupItemRenderer property of the AdvancedDataGrid: mx:AdvancedDataGrid groupItemRenderer="com.whereever. CustomGroupRenderer Or, in ActionScript: myAdvancedDataGrid. GroupItemRenderer = new ClassFactory(com.whereever.

CustomGroupRenderer).

Here's what I did to accomplish this: Create a class that extends AdvancedDataGridGroupItemRenderer In the new class override updateDisplayList and do what you need to do Assign the new class to the groupItemRenderer property of the AdvancedDataGrid Here's what your new class might look like public class CustomGroupRenderer extends AdvancedDataGridGroupItemRenderer { override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super. UpdateDisplayList(unscaledWidth, unscaledHeight); var listData:AdvancedDataGridListData = listData as AdvancedDataGridListData; var advancedDataGrid:AdvancedDataGridDataGrid = listData. Owner as AdvancedDataGrid; var cellBackgroundColor:uint = 0xFF0000; var g:Graphics = graphics; g.clear(); if (!advancedDataGrid.

IsItemSelected(data) &&! AdvancedDataGrid. IsItemBeginFill(cellBackgroundColor); g.

DrawRect(0, 0, unscaledWidth, unscaledHeight); g.endFill(); } } } And then assign this class to the groupItemRenderer property of the AdvancedDataGrid: Or, in ActionScript: myAdvancedDataGrid. GroupItemRenderer = new ClassFactory(com.whereever. CustomGroupRenderer).

This is close to what I need but I not just trying to change the color. I would like to add an VBox to it and put some items in the VBox. I tried this and super.

AddChild but the made the app freeze. Any ideas? – Barrest Apr 15 '10 at 19:15 I think you're going to have to use a combination of the lifecycle methods createChildren (to create the vbox and the vbox children), measure (to figure out the width & height of the renderer based on its children) and updateDisplayList (to position everything inside the renderer like the folder icon, folder label and your vbox).

This thread might help: forums.adobe. Com/message/846259 - There's a link to some sample code that might help you. – Jeremy Mitchell Apr 17 '10 at 4:31 +1 This helped me quite a bit.

Thanks! – Jason Towne Jan 11 at 19:27.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions