This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Description
Before you write your question, please take some extra time to write a good title that is short yet descriptive.
versions using?
- angular version: 1.5.3
- jquery version: 2.2.4
- datatables version: 1.10.15
- angular-datatables version: 0.6.2
My problem?
If there are 5 pages, when i click page 2 then table show ok, but when click on page 1 then table show page 3, it was only working in one direction (draw param always increase by 1 )
My code
Angular Code
$scope.dtOptions = DTOptionsBuilder
.newOptions()
.withOption('ajax', {
contentType: 'application/json',
url: 'http://localhost/users?limit=2',
type: 'get',
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', 'Bearer ' + localStorageService.get('_token'))
}
})
.withDisplayLength(2)
.withOption('processing', true)
.withOption('serverSide', true)
.withOption('searching', false)
.withPaginationType('full_numbers')
.withDataProp('data')
$scope.dtColumnDefs = [
DTColumnBuilder.newColumn('id').withTitle('ID'),
DTColumnBuilder.newColumn('code').withTitle('Code'),
DTColumnBuilder.newColumn('name').withTitle('Name')
]
HTML
<table datatable dt-options="dtOptions" dt-columns="dtColumnDefs" class="uk-table" cellspacing="0" width="100%">
</table>
Server Response
'recordsTotal' => $result->total(),
'recordsFiltered' => $result->total(),
'data' => $result->toArray()['data'],
'draw' => $result->currentPage()
please help me to fix this issue urgently.
Thanks.