Topic: Datatable Row Checkbox: disable or autocheck it

futureweb priority asked 2 years ago

Is there any simpel way to interact with the checkbox that selects a row of a datatable?

(Check it per default or disable the checkbox if some conditions of the row are met?

Dawid Wajszczuk staff answered 2 years ago


You can write your own functions to conditionally check checkbox. Here is a basic example

    if (field.innerHTML==='Tiger Nixon'){
      row.querySelector('input').checked = true

Here is the snippet

Keep coding,

futureweb priority commented 2 years ago

Thanks for the snippet, I used .click() instead of checked = true which will trigger it as clicked to know which ones are checked.

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: No