Topic: A href <tr> Clickable TableRow

Łukasz Kaczor free asked 4 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 4 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

Opened

Specification of the issue

  • ForumUser: 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