How to get column index of header column in AdvancedDataGrid
开发者_开发技巧I want to know column index of header in AdvancedDataGrid
when a user clicks on header - either left click or right click.
AdvancedDataGrid
dispatches a headerRelease
event when you click on its header. This event has a zero based columnIndex property.
There is one problem though: The headerRelease
event is dispatched only if the clicked column is sortable and the data provider supports sorting.
<mx:AdvancedDataGrid headerRelease="handleHeaderClick(event)">
<!-- Columns and stuff -->
</mx:AdvancedDataGrid>
<mx:Script>
<![CDATA[
private function handleHeaderClick(event:AdvancedDataGridEvent):void
{
var index:Number = event.columnIndex;
}
]]>
</mx:Script>
精彩评论