flex datagrid 修改标题排序图标

<s:DataGrid id="datagrid" skinClass="skin.gridSkin">

    

</s:DataGrid>


1.修改 skin.gridSkin皮肤中 添加sortIndicator

 <fx:Component id="headerRenderer">

    <s:DefaultGridHeaderRenderer sortIndicator="{new ClassFactory(MyBitmapImage)}">


    </s:DefaultGridHeaderRenderer>

 </fx:Component>

2.MyBitmapImage.mxml内容如下

<?xml version="1.0" encoding="utf-8"?>

    <s:BitmapImage xmlns:fx="http://ns.adobe.com/mxml/2009" 

       xmlns:s="library://ns.adobe.com/flex/spark" 

       xmlns:mx="library://ns.adobe.com/flex/mx" 

       source="@Embed('assets/images/1_41.png')">

     <fx:Declarations>

     <!-- 将非可视元素(例如服务、值对象)放在此处 -->

     </fx:Declarations>

    </s:BitmapImage>


你可能感兴趣的:(datagrid,Flex,排序图标)