1 Reply Latest reply on Jun 4, 2010 4:23 PM by Flex harUI

    multi-dimension dataprovider and labelFunction

    ltambs

      the data provider below is two-dimensional array.
      I have other pages which use the formatData function, those are array.

      the one-dimension arrays work well.
      but I don't know how to make this function work.
      the second column without labelFunction works.

      Help me.
      Thanks in advance.

      ----------------------------------------------

      <mx:DataGrid x="21" y="146" width="100%" id="dataGrid" dataProvider="{searchTulcasrvprodlListResult.lastResult}">
      <mx:columns>
        <mx:DataGridColumn headerText="Product Name" dataField="tulproduct.productName"/>
        <mx:DataGridColumn headerText="Prod. Reg. Date" dataField="tulproduct.registrationDate"/><!--this work good-->
        <mx:DataGridColumn headerText="Prod. Reg. Date" dataField="tulproduct.registrationDate" labelFunction="formatDate"/>

      ----------------------------------------------

      public function formatDate(item:Object, column:DataGridColumn):String
      {
      var df:DateFormatter = new DateFormatter();
      df.formatString = "DD/MM/YYYY";
      var value:Object = item[column.dataField];
      return df.format(value);
      }