Bind different data at runtime using DTOptionsBuilder.fromFnPromise

Bind different data at runtime using DTOptionsBuilder.fromFnPromise

rahulddeshmukhrahulddeshmukh Posts: 2Questions: 1Answers: 0

I am using $scope.dtOptions = DTOptionsBuilder.fromFnPromise option to bind data to datatables which is inside my directive.

What I am trying is to bind different data source with different column names to datatables.
But when I try to bind second data (with different columns) I am getting below error:
DataTables warning: table id= Requested unknown parameter 'name' for row 0. For more information about this error, please see http://datatables.net/tn/4
I tried with below steps:
1. Get data and column definition into $scope variable dtOptions and dtColumns
2. Clean-up old datatable using below code
var table = $('#' +$scope.Id).DataTable();
table.destroy();
$('#' +$scope.Id).empty();
3. Remove datatable template
$('.tdiv_' + $scope. Id).empty();
4. Set datatable template again

I am not sure what I am missing or may be having wrong sequence.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Answer ✓

    You don't say, but I'm assuming that you are using the Angular DataTables library.

    I think you'd be best asking the Angular DataTables integration author. That integration is thirdparty software and not supported by myself.

    Allan

  • rahulddeshmukhrahulddeshmukh Posts: 2Questions: 1Answers: 0

    Yes DataTables 1.10.7, sure thanks

This discussion has been closed.