Trouble with adding a column that is not part of AJAX dataset
Trouble with adding a column that is not part of AJAX dataset
I am trying to add a checkbox for each row in the first column of my datatable. I have successfully added a remove icon as the last column. I have tried a bunch of stuff and can't get it quite right. Any ideas?
'''js
var selected_table = $('#selected_items').dataTable({
"ajax": '/cfcs/db_items.cfc?method=getSelectedItems&pid=' + packageID,
"columnDefs": [{
"targets": 0,
"defaultContent": "<input type='checkbox' id='key_item'>"
}, {
"targets": 2,
"render": function ( data, type, row, meta ) {
var itemID = row[0];
return '<a href="item_form.cfm?iid=' + itemID + '" data-target="#item" data-toggle="modal">' + data + '</a>';
}
}, {
"targets": 5,
"defaultContent": "<a id='remove' class='btn red btn-xs'><i class='fa fa-times'></i></a>"
}],
"columns": [{
"orderable": false,
}, {
"visible": false,
"orderable": false
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": false,
}],
"paging": false,
"info": false,
"searching": false
});
'''