【问题标题】:AdvancedDataGrid: dataTip = headerTextAdvancedDataGrid:dataTip = headerText
【发布时间】:2012-02-24 08:49:10
【问题描述】:

我有一个非常简单的问题,谷歌没有给我答案:

我有一个 AdvancedDataGrid,我在 ActionScript 中动态构建列(列数可变),并且我希望数据提示在用户将鼠标悬停在单元格上时显示列 headerText。 Adobe 的示例 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"];
  }

但在这种情况下,如果用户将鼠标悬停在列标题上,则该值只是一个 AdvancedDataGrid 列?我希望 dataTip 始终显示该列的 headerText。因此,如果我必须使用此功能,那么如何获取单元格的列 headerText?

据我了解 dataTipField 我不能真正使用它来静态等于 column.headerText (dataTipField = headerText)。

有人对我如何实现这一点有任何指示吗?这似乎是一项非常容易的任务,但我似乎仍然不知道如何:)

【问题讨论】:

    标签: actionscript-3 apache-flex tooltip advanceddatagrid


    【解决方案1】:

    您可以为每列使用不同的函数,可以是匿名的:

    <AdvancedDataGridColumn dataTipFunction="{function(value:Object):String{return 'Data Tip'}}" ... />
    

    【讨论】:

    • 感谢 m8!这就像一个魅力。 column.showDataTips = true; column.dataTipFunction=function(value:Object):String{return headerText};
    猜你喜欢
    • 1970-01-01
    • 2019-08-09
    • 2012-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-23
    • 1970-01-01
    相关资源
    最近更新 更多