Working with keyboard events???

Working with keyboard events???

pkcinnapkcinna Posts: 4Questions: 0Answers: 0
edited February 2012 in General
How to make selected row work based on up/down arrows? I fiddled around with jqueryui "selectable" but couldn't find the magic formula... i got it to work but it looked like a hack since I had to listen for key events on the document itself.

Seems there are significant navigation features missing when using the keyboard. I spent half this morning searching for the right way to use up and down arrows, ctrl-a, and shift selection but did not see anything helpful. It is confusing because the 1.9 release notes say the the table is now fully navigatable (accessibility new features).

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    > It is confusing because the 1.9 release notes say the the table is now fully navigatable (accessibility new features).

    In terms of the built in features yes. However, row selection is not a built in feature, it is something that is a layer above DataTables, like in my example code or in a plug-in like TableTools.

    If you want row selection using keyboard events, then you just need to use typical jQuery key event listening ($().keyup etc) with suitable functions for selecting rows and moving the selection cursor around. I'm afraid I don't have a working example of that, but it would certainly be possible to create that on top of DataTables.

    Allan
  • pkcinnapkcinna Posts: 4Questions: 0Answers: 0
    Guess it is more a javascript issue since my problem is figuring out how the up/down keys get associated with the right table or if they should go to some other element on the page. Datatable has been excellent for most of my requirements besides this one.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    You might be interested in taking a look at KeyTable ( http://datatables.net/extras/keytable ) to see how it does this kind of thing. It is cell based rather than row based, but it might give you some ideas for the interaction.

    Allan
This discussion has been closed.