Editable ListGrid

Can I set up a ListGrid so that I can tab around it like a spreadsheet?

If I have fields in a DynamicForm above it, I’d like to tab from the these fields straight into the Grid and then from the Grid back into the fields.

I guess it would have all rows editable at the same time.

Also, I need a way to insert a new row. I guess continuing with the spreadsheet metaphor, tabbing past the last row would instantiate a new empty row, and tabbing through this without edit would cause the row to be discarded.

Hi,
You can get most of this easily from standard ListGird APIs.

If you set ListGrid.editOnFocus to true, when the user tabs to the listGrid in the pages tab order, it will automatically go into edit mode (and the user will be focussed in the first cell).
This property is not publicly exposed in the 5.5.1 documentation but will be in future builds.

The user can then navigate through the grid much as they would a spreadsheet, using tab to move forward (and to the next row from the last column), and arrow keys to move up and down between rows
[For text areas, use Alt + arrow keys to move between rows - for select items, use Ctrl + arrow keys, as in these editor types unmodified arrow keys have meaning].

If you set ListGrid.listEndEditAction to “done”, when the user reaches the last cell of the grid, hitting tab will hide the editor and allow you to continue to the next widget in the page’s tab order (in your description, this would be a DynamicForm).

Alternatively, if you set the listEndEditAction to “next”, when the user reaches the last cell of the grid, hitting tab will create a new row on the end of the grid and start editing that. In this case the user should be able to finish editing by hitting “enter” or “escape” (either saving or cancelling the edit), and then tab to move on in the page’s tab order.

This isn’t exactly what you describe.

We never show the entire content of the grid as editable - It is possible to style the grid cells in such a way that they appear indistinguishable from editable text boxes to give a clear visual cue that the user can click on any cell to start editing, if this is the appearance you need.

The behavior you describe of either creating a new row, or moving on based on the current row’s set of edits is an interesting one.
The functionality you describe is not impossible to achieve, but would take a little bit of tweaking.
There are a couple of possible approaches. One that springs to mind is to implement an “editorExit()” handler that checked the rowNum, colNum and editCompletionEvent for the case of the user hitting “Tab” in the last cell in the grid, and comparing the new to old values to determine whether to save the edit and startEditingNew(), or cancel the edit entirely.
If you definitely want this behavior, feel free to have a go at making it work with this approach - if you get stuck let us know and we can take a deeper look.

Thanks
Isomorphic Software