Select all checkbox in DataTable of Jquery is not working in second time
Select all checkbox in DataTable of Jquery is not working in second time
priyankaT
Posts: 3Questions: 1Answers: 0
"columnDefs": [
{
`` "targets": 0,
"data":null,
"defaultContent": "",
"checkboxes": {
"selectRow": true
}
},
{
"targets": -1,
"data": null,
"defaultContent": "<i id=\"invoiceButton\" class=\"ion ion-information-circled\" data-toggle=\"modal\" data-target=\"#invoiceModal\" style=\" text-align: center; color: blue; font-size: 16px;\"></i>"
},
{ "width": 50, "targets": 0 },
],
"select": {
"style": "multi" ,
selector: 'tr>td:nth-child(0), tr>td:nth-child(1)'
}
This discussion has been closed.
Answers
It looks like you are creating the select checkbox in column 0 and using the Select extension on column 0. If you look at this example the last column is used for the checkbox and the Select option is disabled on the last column. I think you need to do the same but for column 0.
Kevin
I'm the author of jQuery DataTables Checkboxes extension.
You need to provide unique data for the column containing checkboxes, see Known Limitations.
Also please remove
defaultContent
for column containing checkboxes, it's not needed.See more articles about jQuery DataTables on gyrocode.com.
Hi gyrocode,Thanks.But I have a question,Why selectAll checkbox is working only once. 2nd time what happend in it?
@priyankaT, Without an example or real page, it's hard to say. Can you create an example on jsFiddle or share a link to your page?
See more articles about jQuery DataTables on gyrocode.com.
Interesting. I didn't notice that a plugin was being used, thought it was the Editor example. Tried the plugin with the above code and the Select extension and it works fine. As @gyrocode mentioned please provide an example with the issue.
Kevin
There is one senario,When I select all the data and move to 'Hold' page.If I click on hold page those records found in that.but I can't do Select all.Because it's iternally selected.How could do internally clear data when it move from 1st time??
read this-https://datatables.net/forums/discussion/53281/1-2-6-css-select-datatables-css-not-displaying-select-all-checkbox/p1?new=1
FORM.PHP
RECEBE_FORM.PHP
LINKS PARA .CSS E .JS
Veja example: https://jsfiddle.net/5jh9y1bn/2/