Keyboard Navigation in Flex Datagrid

I want to implement Excel keyboard (arrow keys) navigation in Extended Datagrid in Flex. See the document at http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_11.html that the arrow keys can be used to navigate cells. However, it doesn't work in my case. I can move up and down lines

--- snip ---

When the focus is on the AdvancedDataGrid control:

* 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.

      

--- snap ---

Any ideas on this?

thanks martin

+2


source to share


2 answers


By default, you can select the whole row in advancedDataGrid. You need to change the selection mode to one cell. Then all arrows will work



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

      

+3


source


"do you suggest how I could implement this, by starting typing / pressing enter, I can start editing the cell? Some keydownhandler"



  • Most Flex visual components inherit from UIComponent. UIComponent defines a keyDownHandler that is first called to handle keyboard actions. You can override this in the ADG extension and check if the keyboard input is alphanumeric. IF so, you can start an edit session by setting the editedItemPosition. Hope this helps!
+1


source







All Articles