开发者

How to get column index of header column in AdvancedDataGrid

开发者 https://www.devze.com 2022-12-22 03:38 出处:网络
开发者_开发技巧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 clic

开发者_开发技巧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

精彩评论

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