how to enable full datatable use, not navigation-only

how to enable full datatable use, not navigation-only

mustafamondmustafamond Posts: 40Questions: 11Answers: 0

I have a datatable with keytable enabled. A new row is added from a modal form. When the modal for adding the record is opened, I have to use
$("#example").DataTable().keys.disable();
so that I can properly set focus on the required form fields. When the modal is submitted or closed, I re-enable using
$("#example").DataTable().keys.enable();

This seems to put the datatable in 'navigation-only' mode - none of the events tied to the datatable having to do with keypresses work. I can move around the datatable with the arrow keys only. Once I click on any cell in the datatable with the mouse, all the keypress events start working again.

How do I re-enable the table in full mode, not 'navigation-only' mode? Or is there function to change the table from navigation-only mode to fully active mode?

Thank you

Answers

  • mustafamondmustafamond Posts: 40Questions: 11Answers: 0

    BTW, I also tried
    $("#example").DataTable().keys.enable(true);

    When the datatable is initialized, it is fully active and all keypress events work along with arrow navigation between the cells. It is only when using keys.enable() that it seems to only allow for arrow navigation and no kepress events work.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.