Can't join columns with columnDefs with ajax data
Can't join columns with columnDefs with ajax data

columnDefs: [ {
"targets": 'selectionCol',
orderable: false,
className: 'select-checkbox'
},
columns: [
null,
{ "data": "FIO" },
{ "data": "FullPostNameRU" },
{ "data": "depnameRU" }
],
Shows me this error: "DataTables warning: table id=tableId - Requested unknown parameter '0' for row 0, column 0."
When I putting only "columns" with all data from example (without 'null column'), it works, but selection does not work, although I putted this:
select: {
style: 'multi',
info: false,
selector: 'input:checkbox'
}
I can't show full code, because I'm using IBM Domino. Please help me
This question has accepted answers - jump to:
This discussion has been closed.
Answers
This Editor example here should get you going. The name column is a join:
data.first_name+' '+data.last_name
- you would do the same in your code.Colin
Is there any way to use "columnDefs"? My example (dynamic dialog to choose persons from list) almost works. But I cannot understand, where I made mistake.
Are you looking for something like this example?
Kevin
Yes, Kevin! This example is good, but I want the first column to be check-box. My example not works. May be there is another way to make check-box column with "columns"?
Try removing
columnDefs
and just apply the config incolumns
. Something like this:Kevin
Now it's generating table without errors, but checkbox is not clickable. May be I must use some exact .js?
I use these:
<script type="text/javascript" src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.22/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.6/js/dataTables.responsive.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.6/js/responsive.bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"></script>
Could be the selector you configured:
selector: 'input:checkbox'
. Try using the selector used in this example:https://datatables.net/extensions/select/examples/initialisation/checkbox.html
Kevin
Kevin, thank you very much! Now everything I wanted works well!