Select / Navigation with keydown
Select / Navigation with keydown
Gea
Posts: 33Questions: 13Answers: 1
Hello, i have implemented the Select() extension on my DataTable and i want to implement a function that allow the user to navigate on the table with keyup and keydown, but i don't know how can i do that.
I have thought on row.index() but that won't work.
Can anyone help me?
This discussion has been closed.
Answers
i Tried this, but only remove the remove work:
$('#example tbody').on( 'click', 'tr', function () {
I changed my code, and now work but only with the just above and just below row :
if (e.keyCode == 40){ //arrow down
}
if (e.keyCode == 38){ //arrow up
}
Fixed! this is what i did:
$('#example tbody').on( 'click', 'tr', function () {
Details on how to format code are available here.
Don't add and remove the
selected
class - instead, use therow().select()
androw().deselect()
methods. Details on these methods are available here.Allan
Oh, i will look!
Thanks Allan.
Gea.