A href Clickable TableRow


Topic: A href <tr> Clickable TableRow

Łukasz Kaczor asked 5 years ago

I need to make Clickable tr in my Project, but it only works on first page

    $(document).ready(function () {
            $(".clickable-row").click(function() {
                window.location = $(this).data("href");
            });
         });


Grzegorz Bujański staff answered 5 years ago

Hi. Try this:

$(document).ready(function () {
    const rows = $("#table").dataTable().fnGetNodes();
    $(rows).find('.clickable-row').click(
        function() {
            window.location = $(this).data("href");
        }
    );
});

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.17.0
  • Device: PC
  • Browser: Google Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No