Is it possible to use a renderer for for a treecolumn in an advanceddatagrid and still keep the hierarchal functionality? If I use a renderer provider I lose the the arrow for the tree dropdown. I want to keep the tree functionality and change the display of the column.(and not just the folder image)
<mx:AdvancedDataGridRendererProvider column="{titleCol}" depth="1"
renderer="com.something.titleColumnRenderer"/>
titleColumnRenderer:
<mx:VBox width="100%" xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Label id="titleLabel" textAlign="center" text="sometext" width="100"/></mx:VBox>
Here's what I did to accomplish this:
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.isItemHighlighted(data))
{
g.beginFill(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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With