Search code examples
actionscript-3apache-flexairflash-builder4.5

want to display custome sort indicator in spark DataGrid?


i have data-grid in my application and i want to customize my data-grid so i made a renderer for column and header, but now a problem is that i want to make custom indicator which indicate a sorted column.?

Thanks in advance!


Solution

    1. Create a custom header renderer by copying spark.skins.spark.DefaultGridHeaderRenderer
    2. Find the inner component with id defaultSortIndicator and edit as you see fit
    3. Assign the new renderer to a column: <s:GridColumn headerRenderer="path.to.MyHeaderRenderer" />
    4. If you want to assign it to all columns by default, you can also create a custom DataGrid skin and replace the headerRenderer inner component with your custom renderer:

    .

    <fx:Component id="headerRenderer">
        <myskins:MyHeaderRenderer />
    </fx:Component>