Using KeyTable with Enter and Space

Using KeyTable with Enter and Space

micstermicster Posts: 4Questions: 1Answers: 0

I have a system that I am adding keyboard access to. There are multiple tables and the aim is that pressing Enter or Space on a row in one DataTable changes what is displayed in the later tables and the rest of the page. Here is a mock up of it designed to use the keyboard rather than mouse: live.datatables.net/pehative/8/edit

Everything works well if using the key S to select a row, but using Enter or Space (that should run the same code) sets the focus back to the first DataTable. Should Enter and Space work the same as other keys?

Thanks

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 5,893Questions: 0Answers: 1,020

    Hi @micster ,

    No, KeyTable treats those separately. You could modify that plugin to treat the keys differently so that they behave how you want.

    Cheers,

    Colin

  • micstermicster Posts: 4Questions: 1Answers: 0

    Thanks @colin. I think modifying the plug-in is beyond me at the moment and I expect that staying with the standard plug-in will have other benefits. I'll use KeyTables as it is (hopefully the nightly version will be included in a new released version soon), remove Enter and Space from the allowed keys and make sure I give clear instructions for use of the keyboard. :)

  • micstermicster Posts: 4Questions: 1Answers: 0

    Any idea when 2.51 will move from nightly dev to release?

  • colincolin Posts: 5,893Questions: 0Answers: 1,020
    Answer ✓

    Hi @micster ,

    It will be soon - hopefully in two weeks or so. We need to update the CDN first, which is almost complete, then all the releases will be made immediately after,

    Cheers,

    Colin

  • micstermicster Posts: 4Questions: 1Answers: 0

    Brilliant, thanks @Colin :) :)

Sign In or Register to comment.