开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜