【问题标题】:Flex DataGrid - Edit the selected cell when enter key is pressedFlex DataGrid - 按下回车键时编辑选定的单元格
【发布时间】:2012-06-17 09:26:05
【问题描述】:

我正在使用 flex 应用程序。当我在选定的单元格上按 ENTER 键时,我想启用我的 Flex DataGrid 单元格可编辑。特定单元格包含一个 itemRender。我知道 F2 键会做的事情。但我想覆盖那个函数。

任何机构都可以帮助我完成这项工作吗...

提前谢谢...

【问题讨论】:

    标签: actionscript-3 apache-flex datagrid flex4.5


    【解决方案1】:

    您可以创建一个扩展 spark 数据网格的类并像这样覆盖 editKey:

    package mypackage
    {
        import flash.ui.Keyboard;
    
        import mx.core.mx_internal;
    
        import spark.components.DataGrid;
    
        use namespace mx_internal;
    
        public class CustomDataGrid extends DataGrid
        {
            public function CustomDataGrid()
            {
                super();
                super.mx_internal::editKey = Keyboard.ENTER;
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-05
      • 1970-01-01
      • 2011-01-09
      • 2010-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多