0
I am implementing a datatable in my web project, I have repeated the implementation of the datatable several times to remedy the problem, but without success. The problem is that the datatable features do not work in my table. As you can see below:
I’ve already added the datatable files to my project repository, downloaded directly from Datatables.net. my html file is like this:
#{extends 'main.html' /}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
$(document).ready(function() {
$('#tabela1').DataTable();
});
</script>
<ol class="breadcrumb">
<li><i class="fa fa-dashboard"></i> <a href="@{Application.index}">Dashboard</a></li>
<li class="active"><i class="fa fa-user"></i> Funcionários</li>
</ol>
<div class="panel panel-default">
<div class="panel-heading">
<button type="submit" class="btn btn-success"
onclick="window.location.href='/funcionarios/formFuncionarios';">
Novo funcionário</button>
</div>
<div class="panel-body">
<input type="hidden" name="funcionario.id" value="${f?.id}" />
<table id="tabela1" class="table table-striped table-bordered table-over">
<thead>
<tr>
<th>Nome</th>
<th>Função</th>
</tr>
</thead>
<tbody>#{list items:funcionarios, as:'f'}
<tr>
<td>${f.nome}</td>
<td>${f.funcao}
<div class="pull-right action-buttons">
<a href="@{funcionarios.editarFuncionarios(f.id)}" class="edit"><span
class="glyphicon glyphicon-pencil"> Editar</span></a> <a
href="@{funcionarios.removerFuncionarios(f.id)}" class="trash"
data-toggle="confirmation" data-btn-ok-label="Sim"
data-btn-ok-class="btn-success" data-btn-cancel-label="Não"
data-btn-cancel-class="btn-danger"
data-title="Remover funcionário"
data-content="Tem certeza que deseja excluir este registro?"><span
class="glyphicon glyphicon-trash"> Remover</span></a> <a
href="@{funcionarios.detalhesFuncionarios(f.id)}" class="flag"><span
class="glyphicon glyphicon-eye-open"> Detalhes</span></a>
</div></td>
</tr>#{/list}
</tbody>
</table>
</div>
remembering that in my main.html is already referencing the scripts used:
<link rel="stylesheet" type="text/css" media="screen" href="@{'public/media/css/jquery.dataTables.min.css'}"/>
<script src="@{'public/javascripts/jquery-3.2.1.min.js'}"></script>
<script src="@{'public/js/custom.js'}"></script>
<script src="@{'public/media/js/jquery.dataTables.min.js'}"></script>
<script src="@{'public/media/js/dataTables.bootstrap.min.js'}"></script>
<!-- Bootstrap Core JavaScript -->
<script src="@{'public/js/bootstrap.min.js'}"></script>
When inspecting the page I see this error, but I can’t find the error in this code snippet.
Open your browser console and see if it returns any errors
– usuario