Run AJAX on row selection with keyboard data row selection

Run AJAX on row selection with keyboard data row selection

jigar311982jigar311982 Posts: 70Questions: 31Answers: 0
edited July 2021 in Free community support

Description of problem:

I have data tables with server-side configured.
I can load data for detailed view with a click on a specific row, when click AJAX will pull data and show in the window.

How can I load data or run AJAX by keyboard up-down arrow keys? This means when I move to the next record it should run AJAX.

Currently, I am running AJAX as below with click.

        $(document).on(
            "click",
            "#myTable tbody td:not(:first-child)",
            function() {
                var rowdata = $("#myTable")
                    .DataTable()
                    .row($(this).parents("tr"))
                    .data();
                jQuery.ajax({.....

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    It might be worth looking at KeyTable, see example here. You can listen for key-focus to trigger the Ajax call.

    Colin

Sign In or Register to comment.