dataTables don't work with 2 and 3 complex headers
by Serg Krasov
HTML
<script src="//cdn.datatables.net/1.10.6/js/jquery.dataTables.js"></script>
<table id='data_panel'>
<thead>
<tr>
<th rowspan="3" colspan="1"></th>
<th rowspan="1" colspan="1">Средний Бизнес</th>
<th rowspan="2" colspan="1">Физические Лица</th>
</tr>
<tr>
<th rowspan="1" colspan="1">На финансирование активов2</th>
</tr>
<tr>
<th rowspan="1" colspan="1">На финансирование активов3</th>
<th rowspan="1" colspan="1">На финансирование недвижимости</th>
</tr>
</thead>
<tbody></tbody>
</table>
JavaScript
var myDataTable = $('#data_panel').dataTable({
data: [{
"check0": {
"id": "512",
"title": "рубли",
"html": "<input type=\"checkbox\" value=\"512\" checked>рубли</input>"
},
"check1": {
"id": "112",
"title": "На финансирование активов3",
"html": "<input type=\"checkbox\" value=\"112\" checked>112</input>"
},
"check2": {
"id": "82",
"title": "На финансирование недвижимости",
"html": "<input type=\"checkbox\" value=\"82\" checked>82</input>"
}
}],
columns: [{
"data": "check0"
}, {
"data": "check1"
}, {
"data": "check2"
}],
aoColumnDefs: [{
"targets": 0,
"sClass": "grayColumn",
"render": {
"_": "html",
"filter": "id",
"display": "html"
},
"bSortable ": false
}, {
"targets": 1,
"data": "check1",
"render": {
"_": "html",
"filter": "id",
"display": "html"
},
"bSortable ": false
}, {
"targets": 2,
"data": "check2",
"render": {
"_": "html",
"filter": "id",
"display": "html"
},
"bSortable ": false
}]
});