jquery - Datatbles squaredFour checkbox multidelete feature -


i working on project, displays data through datatables jquery plugin. in first column of datatable, put checkbox specifically, bootstrap squaredfour checkbox. so, first column in rows, has checkbox. next task able delete rows checked. have delete button @ top, gets activated if there atleast 1 checked row. once user clicks on delete button, should able delete row.

i not understand, reason, not able select more 1 row. once check on 1 checkbox, selected , if try select other checkbox, selected checkbox getting unchecked. happening first checkbox. because of bootstrap?

this code checkbox. returned table data,

  $('#example').datatable({     "processing": true,         "serverside": true,             "spaginationtype": "full_numbers",            // "ajax": "http://localhost:9080/datatable/tests/user.php"                 "ajax" : {                     "url" : "http://localhost:9080/swetha/swetha_gmail_to_bbe/trunk/public/" + "swethasemail/mail-ajax/get-data-table/format/json/",                     "datatype": "json"                 },                 "columndefs": [{                         "targets": 0,                         "orderable": false,                         "classname": "dt-body-center",                         "render": function(data, type, full, meta){                              return '<div class="squaredfour "><input type="checkbox" value="none" id="squaredfour" name="check" /><label for="squaredfour"></label></div>';                          },                  }], 

in above code returns checkbox populated in td field in datatable. the checkboxes on user interface

please suggest me solution this. or if there other possibility implement checkbox feature on datatable multi delete, please let me know.

as suggested in comments, can @ datatables extension: https://datatables.net/extensions/select/examples/initialisation/multi.html

alternatively, here's how got work:

"columns": [     {         data: "approved",          render: function ( data, type, full, meta ) {             return '<input type="checkbox" id="' + full.id + '"/>&nbsp;';         }     }, ], 

note every input has unique id.


Comments