0
I am working with an example of datatable rowgroup and getting an error like this when loading the page:
Datatables Warning(table id = 'example'): cannot reinitialise data table ##
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#example').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "tableProcessa.php",
"type": "POST"
}
});
});
</script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#example').DataTable({
order: [
[0, 'asc']
],
rowGroup: {
dataSrc: 0
}
});
});
</script>
<table width="100%" class="display" id="example" cellspacing="0">
<thead>
<tr>
<th>OP</th>
<th>Nome</th>
<th>Cliente</th>
<th>Trabalho</th>
<th>Data</th>
<th>Obs</th>
</tr>
</thead>
</table>
You can’t start datatables twice. I don’t understand why you’re doing this in the same ready event, though in separate blocks. Kind of pointless that.
– Sam
Because you don’t put the two together
$('#example').DataTable({
in one?– Sam