Topic: How to add button on each row - I want to have a dialog box to appear when a certain row is clicked and display row data or a button next to each row. Thanks in advance for your help.

coders_key free asked 2 months ago


$('#data-table tbody').on('click', 'tr', function () { var data = table.row(this).data(); alert('You clicked on ' + data\[0\] + "'s row");
    });

mlazaru staff answered 2 months ago


Hi,

Do you want to add a button for each row or just listen for a click on body? Because in code you sent there are no buttons.

If the case is just to get alert with information about clicked record data, check out my snippet: https://mdbootstrap.com/snippets/standard/mlazaru/4207539#js-tab-view



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 4.2.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No