Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

I am trying to use angulat-datatables and getting the error - TypeError: Cannot read property 'parentNode' of null while using angular-datatables". Note: all index files and dependencies have been included.

view.html

<table datatable="" dt-options="dtOptions" dt-columns="dtColumns" class="row-border hover">
</table>

controller.js

$scope.finalArray = [];
$scope.dtOptions;
$scope.dtColumns;
/*code includes a function call to url to fetch data
after it is successful, it goes to function dt */

 function dt(){
$scope.dtOptions = DTOptionsBuilder.fromFnPromise(function(){return $q.when($scope.finalArray);})
    .withTableTools("bower_components/datatables-tabletools/swf/copy_csv_xls_pdf.swf")
    .withTableToolsButtons([
        'copy',
        'print', {
            'sExtends': 'collection',
            'sButtonText': 'Save',
            'aButtons': ['csv', 'xls', 'pdf']
        }
    ]);
 $scope.dtColumns = [];
    for(var i in $scope.columnTable){    $scope.dtColumns.push(DTColumnBuilder.newColumn($scope.columnTable[i]).withTitle($scope.columnTable[i]));
}
  }

This is the error message that I am getting error message :

at Object.<anonymous> (jquery.dataTables.min.js:131)
at Object.t.iterator (jquery.dataTables.min.js:96)
at Object.<anonymous> (jquery.dataTables.min.js:131)
at Object.t.extend.g [as destroy] (jquery.dataTables.min.js:99)
at m.fnDestroy (jquery.dataTables.min.js:80)
at HTMLTableElement.<anonymous> (jquery.dataTables.min.js:84)
at Function.n.extend.each (jquery.min.js:2)
at n.fn.n.each (jquery.min.js:2)
at m [as dataTable] (jquery.dataTables.min.js:83)
at h.fn.DataTable (jquery.dataTables.min.js:159)

How can I solve this?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.