Date sorting problem
Date sorting problem
rhem
Posts: 4Questions: 1Answers: 0
Whenever I am trying to sort a column in from the controller in angualrjs, I always get a warning...this is the code, what can i do?
httpAgent.getLoginHistory().then(response => {
$scope.loginData = response.data;
$(document).ready(function () {
$('#table_id').DataTable({
columnDefs: [{
targets: [2],
orderData: [1, 0]
}]
}
);
});
})
This discussion has been closed.
Answers
What is the warning?
Kevin
DataTables warning: table id=table_id - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3
this is it, but I have applied the recommended solution and it still gives the same warning
You'll get that error when the table is being initialised again - so that
getLoginHistory()
code is being called more than once. DataTables wouldn't do that when ordering, so it must be something be triggered in Angular.Colin
Oh alright, thanks. I'll see what is causing the triggers then.
hi again, i have removed what was causing the trigger, but my date in the third column is not sorting.
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin