Unclear how to make clickable rows in datatable


Topic: Unclear how to make clickable rows in datatable

jasonh pro premium priority asked 2 years ago

Expected behavior Make rows clickable in datatable

Actual behavior Can't understand how it's working based on the documentation

I don't want checkboxes, I just want to click a row and have it highlight the row and trigger some code to happen. Is there some better documentation or example?

Resources (screenshots, code snippets etc.)


jasonh pro premium priority answered 2 years ago

I ended up adding (click)="myFunction()" to the <tr> and it's working - I guess the row is clickable by default. Although still not clear how the ones from the documentation are working.


Michał Duszak staff commented 2 years ago

It works exactly this way. You can make use (click) event to perform some code upon a row click. In the live preview demo from the documentation it triggers a modal.


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 2.3.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes