Datatables responsive child rows NOT from ajax
HTML
<link rel="stylesheet" href="https://cdn.datatables.net/r/dt/dt-1.10.9/datatables.min.css">
<script src="https://cdn.datatables.net/r/dt/dt-1.10.9/datatables.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<table id="sort1" aria-describedby="sort1_info" class="table responsive table-bordered table-hover table-striped table-super-condensed dataTable no-footer" role="grid">
<thead>
<tr role="row">
<th>Last Name</th>
<th>First Name</th>
<th>Init.</th>
<th>Email</th>
<th>Company</th>
<th>Prio.</th>
<th>Owner</th>
<th class="no-sort">Due Date</th>
<th class="no-sort">
<div align="center" title="Rejected">Rej'd</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Declined">Decl</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Obtained Name">Obt'n</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Appointment Scheduled">App't</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Some Interest">Int'd</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Non Disclosure Issued">ND i</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Non Disclosure Signed">ND s</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Presented">Pres.</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
<div align="center" title="Very Interested">Ve Int</div>
</th>
<th class="no-sort sorting_disabled" rowspan="1" colspan="1">
...
JavaScript
$(document).ready(function() {
var table = $('#sort1').DataTable({
stateSave: true,
filter: false,
"paging": false,
"pageLength": 25,
"lengthMenu": [
[10, 25, 50, -1],
[10, 25, 50, "All"]
],
"columnDefs": [{
"type": "html",
"targets": ['no-sort'],
"orderable": false,
}, ],
"autoWidth": false,
"tableTools": {
"aButtons": [{
"sExtends": "collection",
"sButtonText": "Export",
"aButtons": [ // Need to do for each export option because of lack of inheritance in Table Tools as at 2.2.2
{
sExtends: "csv",
"mColumns": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] //Only export the columns with useful values
}, {
sExtends: "xls",
"mColumns": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
},
]
}],
"sSwfPath": "/Scripts/plugin/datatables/TableTools/swf/copy_csv_xls.swf"
},
// This sets the resulting html layout i.e. https://datatables.net/reference/option/dom
"dom": "<'dt-toolbar'<'col-xs-12 col-sm-6'fi><'col-sm-6 col-xs-6 hidden-xs'plT>r>" +
't<"dt-toolbar-footer"<"col-sm-6 col-xs-12 hidden-xs"i><"col-xs-12 col-sm-6"p>><"clear">"',
// group by profile if shown
"drawCallback": function(settings) {
if ($('#ShowProfile').val() == 'true') {
var api = this.api();
var rows = api.rows({
page: 'current'
}).nodes();
var last = null;
// Create a row for the groupings.
api.column(0, {
page: 'current'
}).data().each(function(group, i) {
if (last !== group) {
if (group != '') {
$(rows).eq(i).before('<tr><th class="groupDark" colspan="22">' + group + '</td></tr>');
}
last = group;
}
});
// remove the first column
api.column(0).visible(false);
}
}
});
// Order by the grouping row
$('table#sort1...