Search code examples
apache-flexflex-datagrid

how to generate serial number using labelFunction in datagrid?


how to generate serial number using labelFunction in datagrid?


Solution

  • What do mean by generating serial number? Based on what?

    Edit:

    <fx:Script>
    
    private function myLabelFunc(item:Object, col:AdvancedDataGridColumn):String
    {
    var itemIndex:int = dataprovider.getItemIndex(item);
    return itemIndex.toString();
    }
    
    <mxml>
    <mx:AdvancedDataGridColumn headerText="Serial No." labelFunction="myLabelFunc"/>