I am using angular-datatables with server side processing. When you specify the datatable attribute in table it will be transformed as datatable. But I want to manually do this after resolving one Ajax request.
$scope.dtOptions = DTOptionsBuilder
.newOptions()
.withOption('ajax', {
url: config.apiBasePath + '/getTasks',
type: 'GET',
beforeSend: (xhr)->
xhr.setRequestHeader('access-token', $scope.user.api_key)
xhr.setRequestHeader('uid', $scope.user.uid)
})
.withDataProp('data')
.withOption('processing', true)
.withOption('serverSide', true)
.withPaginationType('full_numbers')
$scope.dtColumns = [
DTColumnBuilder.newColumn('title').withTitle('Title'),
DTColumnBuilder.newColumn('keywords').withTitle('Keywords')
DTColumnBuilder.newColumn('number_of_completions').withTitle('Number Of Completions')
DTColumnBuilder.newColumn('reward_per_completion').withTitle('Reward Per Completion')
]
In the above code datatable ajax request should be initiated after $scope.user resolved. Else I am getting 401.
I don't see any doc to manually setup datatables. Any idea?