I'm trying to create an example of Dynatable with pagination, to do this, I created an html file and a json loaded using Ajax, directly from the same directory as the html file.
The data is rendered correctly, te footer says: "Showing 5 of 5 records (filtered from 45 total records)", that's ok also. The problem is the link at the right, only displays 1 page, when it should show 9 pages.
This is the html content:
<body>
<div class="dynatable-demo">
<table id="my-ajax-table" class="table table-bordered hoverTable">
<thead>
<tr>
<th data-dynatable-column="idturno" data-dynatable-no-sort="true">Id Turno</th>
<th data-dynatable-column="accessionnumber">Accesion Number</th>
<th data-dynatable-column="apellidopaterno">Apellido Paterno</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script>
$('#my-ajax-table').dynatable({
dataset: {
ajax: true,
ajaxOnLoad: true,
ajaxUrl: 'consulta.json',
records: [],
perPageDefault: 5,
perPageOptions: [5,10,100]
}
});
</script>
And here's the "consulta.json" file:
{
"records": [
{
"idturno": "88",
"accessionnumber": "24471579",
"apellidopaterno": "DORATO^PABLO EZEQUIEL"
},
{
"idturno": "89",
"accessionnumber": "0001",
"apellidopaterno": "apepaterno"
},
{
"idturno": "90",
"accessionnumber": "0002",
"apellidopaterno": "apepaterno"
},
{
"idturno": "91",
"accessionnumber": "0003",
"apellidopaterno": "apepaterno"
},
{
"idturno": "92",
"accessionnumber": "0004",
"apellidopaterno": "apepaterno"
}
],
"queryRecordCount": 5,
"totalRecordCount": 45
}