Angular-Datatable ajax data not displayed

Angular-Datatable ajax data not displayed

DillGatesDillGates Posts: 1Questions: 1Answers: 0

Hi Folks :-
I've implemented angular-datatables in my project successfully and getting the ajax data properly. But the problem is, it is not displayed in the table view. I have shared my code and screenshot for your review. Please update me regarding this.
Thanks in advance.

My HTML :-

My Script :-
app.controller('datatable.Controller', function ($scope, global_scope, DTOptionsBuilder, DTColumnBuilder) {
var vm = this;
vm.dtOptions = DTOptionsBuilder.newOptions()
.withOption('ajax', {
url: global_scope.api_base_path+'getdetails.php',
type: 'POST',
data: function(data, dtInstance) {
// Modify the data object properties here before being passed to the server
data.role="1";
data.usr_id=$scope.dsp_id;
loadtype=$scope.type;
}
})
.withDataProp('data')
.withOption('serverSide', true)
.withPaginationType('full_numbers');
vm.dtColumns = [
DTColumnBuilder.newColumn('test1').withTitle('test1'),
DTColumnBuilder.newColumn('test2').withTitle('test2'),
DTColumnBuilder.newColumn('test3').withTitle('test3'),
DTColumnBuilder.newColumn('test4').withTitle('test4'),
DTColumnBuilder.newColumn('test5').withTitle('test5'),
DTColumnBuilder.newColumn('test6').withTitle('test6'),
DTColumnBuilder.newColumn('test7').withTitle('test7'),
DTColumnBuilder.newColumn('test8').withTitle('test8')
];
});

Ajax Response :-
{"draw":"1","recordsTotal":"181","recordsFiltered":181,"data":[["1","2","5","Chennai, TN","Chennai, TN","1445077800","UTC","0"],["2","2","5","Chennai, TN","Chennai, TN","1445077800","UTC","0"],["3","4","8","Fremont, CA","LA, CA","1445220000","UTC","0"],["4","4","8","Santa Clara, CA","Sacramento, CA","1445250600","UTC","0"],["5","4","8","Fremont, CA","Napa, CA","1445250600","UTC","0"],["6","4","8","Newark, CA","LA, CA","1445265000","UTC","0"],["7","4","8","Hayward, CA","Fresno, CA","1445049900","UTC","0"],["8","4","8","Hayward, CA","Fresno, CA","1445226300","UTC","0"],["9","6","12","Santa Clara, CA","Huntington Beach, CA","1445250600","UTC","0"],["10","5","13","San Jose, CA","Pleasanton, CA","1445250600","UTC","0"]]}

Output link :-
https://photos.google.com/share/AF1QipMEGsh8R8wU9zDYOvQRDtw7OBZbuJa7qySGf0E2L-76dboxlCX52jEZONRk6fu82Q?key=cl9PRzlDWE8yYzR3aXp0WHlWYW90cGFaai15TkdR

This discussion has been closed.