You lack to tell how exactly you generate those checkboxes. So the following is just how what I would do it. There isnt really difference if the checkboxes is inside a dataTable or anything else.
Example of creating a lot of checkboxes inside a dataTable, all with unique ID
's :
for (var row=1;row<=10;row++) {
dataTable.fnAddData([
'<input type="checkbox" id="check_'+row+'_1">',
'<input type="checkbox" id="check_'+row+'_2">',
'<input type="checkbox" id="check_'+row+'_3">',
'<input type="checkbox" id="check_'+row+'_4">',
]);
}
A shorthand function for retrieving the right checkbox, based on row, col
pairs :
function dtCheckBox(row, col) {
return document.getElementById('check_'+row+'_'+col);
}
Some examples to show the concept is working :
//setter examples, check 20 random checkboxes
for (var i=0;i<20;i++) {
var row=Math.floor(Math.random()*10)+1,
col=Math.floor(Math.random()*4)+1;
dtCheckBox(row, col).checked=true;
}
//getter example, console out the checked status of all checkboxes
for (col=1;col<=4;col++) {
for (row=1;row<=10;row++) {
console.log(dtCheckBox(row, col).checked);
}
}
See the above in action in this fiddle -> http://jsfiddle.net/EpLA7/