Use case:
- a Grid is displaying a list of items
- the user can click a button to edit the selected item
- when the user clicks "edit" a dialog is displayed for editing the item
- the user would like to have "edit next" and "edit previous" buttons on the dialog to automatically save the current item and advance to the next or previous item in the Grid
The twist: the Grid is sortable by the user using the standard column-based sorting, which is apparently implemented entirely on the client side.
The problem: the "index" of an item within the Grid returned by Grid.getRowIndex() returns the index within the unsorted list. Implementing the next/previous function off of this index can cause the selection to appear to jump around randomly if the user has sorted the Grid.
The question: Is there a way to get the display row index of the selected item? And conversely, is there a way to get the item at a specified display row index? Or, as an alternative, does the Grid have a way to move the selected row index forward or backwards by a given amount in display order?