Smart-Table
Smart-Table copied to clipboard
Any possible way to do keyboard navigation?
e.g. Select a single row and use up/down to do the navigation?
I believe so, but I don't think is part of the scope of smart-table
+1 @Tedko did you find a way to do this?
@Tedko @rdehuyss @lorenzofox3 - Probably a bit late but I have created a solution for this.
You could create a table navigation service which tracks the current row and exposes navigation methods to modify the current row's value and sets focus to the row.
Then all you would need to do is create a key binding directive where you could track key down events and fire the exposed methods from the table navigation service, on key up or key down.
I have used a controller to link the service methods to the key binding directive via a configuration object called 'keyDefinitions'.
You can extend the keyDefinitions to include the 'ENTER' key (Code: 13) and hook on to the selected $index value via the service property 'tableNavigationService.currentRow' or '$scope.data', then pass it as a parameter to your own custom submit() function.
I hope that this is helpful to somebody.
I have posted my solution to this issue at the following plunker location: Keyboard Navigation Service Demo