I am currently facing an issue with populating a datatable in AngularJS.
DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
Below is the data returned from the API using Ignited Datatables:
data: Array(145)
[0 … 99]
0: {id: "0", uid: "21912"}
1: {id: "1", uid: "22000"}
2: {id: "1.2345666664667e32", uid: "21967"}
3: {id: "1.2345676773423e30", uid: "21970"}
4: {id: "1.2345676777777e20", uid: "21969"}
5: {id: "1001", uid: "22008"}
[100 … 144]
100: {id: "PS1548080820", uid: "22117"}
101: {id: "PS1548081358", uid: "22118"}
102: {id: "PS1548082263", uid: "22119"}
draw: 0
recordsFiltered: "145"
recordsTotal: "145"
My Javascript code utilizes a promise to retrieve this data:
$scope.dtColumns = DTColumnBuilder.newColumn('id').withTitle('ID'),
DTColumnBuilder.newColumn('uid').withTitle('UID');
$scope.dtOptions = DTOptionsBuilder.fromFnPromise(function()
{
return ApiService.GetTableDate($scope.searchParams, $scope.currentPage, $scope.pageSize).then(function (result)
{
return result.data;
});
})
.withPaginationType('full_numbers')
.withOption('deferRender', true)
.withDisplayLength(10)
.withOption('initComplete', function() { });
The HTML code used is as follows:
<table datatable="" dt-options="dtOptions" dt-columns="dtColumns"
class="table table-bordered table-striped">
<thead>
<tr>
<th>UID</th>
<th>ID</th>
</tr>
</thead>
</table>
If anyone could provide assistance on where I might be making a mistake, it would be greatly appreciated.
Thank you in advance.