views:

24

answers:

1

Hi all!

I have to create a custom header for the AdvancedDataGrid component. The custom header must have two buttons in it. The custom renderer must be applied to more than one column.

How I can fire, dispatch and handle events from the custom headers? Any examples or tutorials are welcome!

A: 

A custom header is just like any other renderer.

Just make sure the events bubble and then you can listen to them as if they were fired directly from the AdvancedDataGrid class. You won't get MXML code hinting for them, but you'll have no problems using addEventListener in ActionScript.

www.Flextras.com
Thank you for your answer! I got the idea. But, if I use the same header renderer for several columns in this way: <mx:AdvancedDataGridColumn dataField="name" headerRenderer="render1"/>, how I can determine which header provided event?
MinimeDJ
You can reference the currentTarget and/or Target on the event Object.http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObject.html#event:click
www.Flextras.com