mercredi 17 août 2016

Disable JQuery datatable checkbox when selected by user

I would like to disable the datatable checkbox (which is the first column of my table). Basically, when a button is clicked, all selected checkboxes should be disabled.

I am able to get the indices of selected rows by using

table.column(0).checkboxes.selected();

But I'm not quite sure how to proceed from there, aka how to reference the checkbox elements. I've tried using

var checkboxes = document.querySelectorAll('input[type=checkbox]')

to get all checkboxse, but I wasn't able to use prop('disabled', false). For example, when I do

checkboxes[1].prop('disabled', false)

I get the "prop is not a function" error.

Could someone help me here?




Aucun commentaire:

Enregistrer un commentaire