1

I have a pretty straightforward question which google fails to give me the answer to :

I have an AdvancedDataGrid where i build the columns dynamically (variable number of columns) in ActionScript, and i want the dataTip to display the column headerText when the user hovers over a cell. Adobe's example dataTipFunction:

  private function tipFunc(value:Object):String
  {
      if (value is AdvancedDataGridColumn)
          return "Column Name";

      // Use the 'name' property of the data provider element.
      return "Name: " + value["name"];
  }

But in this case the value is only an AdvancedDataGrid column if the user hovers over a column header? I want the dataTip to always show the headerText for that column. So if i have to use this function, then how do i get the column headerText for a cell?

And as i understand the dataTipField i can't really use it to statically equal column.headerText (dataTipField = headerText).

Anyone have any pointers on how i can achieve this? It seems like a really easy task, still i can't seem to find out how :)

Sebastian
  • 436
  • 5
  • 24

1 Answers1

0

You can use a different function per column, which could be anonymous:

<AdvancedDataGridColumn dataTipFunction="{function(value:Object):String{return 'Data Tip'}}" ... />
Eduardo
  • 8,362
  • 6
  • 38
  • 72
  • Thanks m8! That worked like a charm. column.showDataTips = true; column.dataTipFunction=function(value:Object):String{return headerText}; – Sebastian Feb 24 '12 at 12:32