How to check a checkbox inside an hidden column ?
How to check a checkbox inside an hidden column ?
Hello,
I've a datatable with checkboxes that are stored in a column ( with "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 4 ] } ] statement). And a button (id #selectall) to checck/uncheck all these checkboxes. I've tried many ways but they remains unckecked.
[code]
$('#selectall').toggle(
function() {
//$("input[type='checkbox']", oTable_A.fnGetNodes()).each(function() {
//$(oTable_A.fnGetNodes()). find(":checkbox") . each(function() {
// $(this).prop('checked', true); }); // doesn't work at all
$("input[type='checkbox']", oTable_A.fnGetNodes()).prop('checked', true); // doesn't work either
$("input[type='checkbox']", oTable_A.fnGetHiddenNodes()).prop('checked', true); // nore this doesn't work either
},
function() {
$("input[type='checkbox']", oTable_A.fnGetNodes()).each(function() {
$(this).prop('checked', false); });
}
);
[/code]
Here an example of the table rows :
[code]
Voir
Ecole
Nb
L
0000001
2
INFO 0000001
Nom Prénom
Quotité
Inscriptions
Quota
Sel
M. AA
? %
14APC1E
6h/?h
M. BB
? %
14APC1F
6h/?h
[/code]
I would like to be able to un/select all the .selens checkboxes... But all my attempts were useless.
Can you help ?
Thanks a lot !
I've a datatable with checkboxes that are stored in a column ( with "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 4 ] } ] statement). And a button (id #selectall) to checck/uncheck all these checkboxes. I've tried many ways but they remains unckecked.
[code]
$('#selectall').toggle(
function() {
//$("input[type='checkbox']", oTable_A.fnGetNodes()).each(function() {
//$(oTable_A.fnGetNodes()). find(":checkbox") . each(function() {
// $(this).prop('checked', true); }); // doesn't work at all
$("input[type='checkbox']", oTable_A.fnGetNodes()).prop('checked', true); // doesn't work either
$("input[type='checkbox']", oTable_A.fnGetHiddenNodes()).prop('checked', true); // nore this doesn't work either
},
function() {
$("input[type='checkbox']", oTable_A.fnGetNodes()).each(function() {
$(this).prop('checked', false); });
}
);
[/code]
Here an example of the table rows :
[code]
Voir
Ecole
Nb
L
0000001
2
INFO 0000001
Nom Prénom
Quotité
Inscriptions
Quota
Sel
M. AA
? %
14APC1E
6h/?h
M. BB
? %
14APC1F
6h/?h
[/code]
I would like to be able to un/select all the .selens checkboxes... But all my attempts were useless.
Can you help ?
Thanks a lot !
This discussion has been closed.
Replies