Flex中的键盘导航Datagrid

问题描述:

我想在Flex中的高级数据网格中实现类似Excel的键盘(箭头)导航。 http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_11.html 的记录中指出可以使用箭头键在单元格周围导航。但是,在我的情况下,这是行不通的。我只能浏览行上下Flex中的键盘导航Datagrid

---剪断---

当焦点位于AdvancedDataGrid控件:

* Use the Left, Right, Up, and Down Arrow keys to move between cells. 
* Use the Shift+Home and Shift+End keys to move to the first and last column in current row. 
* Cells are only selected by default, they are not editable. 
* Press the F2 key to make a cell editable. 

---扣---

任何关于这个的想法?

THX, 马丁

默认情况下,您可以选择在AdvancedDataGrid一整行。您需要将选择模式更改为单个单元格。然后,所有的箭头将工作

<mx:AdvancedDataGrid id="myADG" 
         width="100%" 
         height="100%" 
         color="0x323232" 
         selectionMode="singleCell" 
         initialize="gc.refresh();"> 
+0

嗨菲尔, 谢谢!这很好 - 不知道我可以设置这个属性。 现在,我可以使用游标导航 - 您是否可以通过开始输入/按下回车键来实现该功能?我可以开始编辑单元格吗?一些keydownhandler? 谢谢 – Martin 2009-08-21 10:01:23

  • 大多数Flex可视“你一个suggstion如何,我可以通过开始输入/按下回车键我就可以开始编辑单元格?有些keydownhandler implemente说”组件从UIComponent继承。 UIComponent定义了一个keyDownHandler,它首先被调用来处理键盘操作。您可以在ADG的扩展名中覆盖此项,并检查键盘输入是否为字母数字。如果是这样,您可以通过设置editedItemPosition来开始编辑会话。希望这可以帮助!