Yes I have search and there are results for it, but I am specifically 
looking for a scenario
where my api call happens after , and the datatable is already initialise 
as a part of directive in table tag.
How do I handle such scenario ?


On Thursday, October 25, 2018 at 12:29:37 AM UTC+5:30, Komal Shah wrote:
>
> We are using $http to get array of columns and then bind it to dtColumns 
> object of angular datatable.
> But before the bind code is called, 'aDatasort is not defined ' error 
> occurs.
>
> Below is the html code
>  <table datatable="" dt-options="showCase.dtOptions"  class="row-border 
> hover"></table>
>
> Below is the Controller code
> ($scope.col is the array of columns which are build using $http)
>
>
>
> vm.dtOptions = DTOptionsBuilder.newOptions()
>         .withOption('ajax', {
>          // Either you specify the AjaxDataProp here
>          // dataSrc: 'data',
>          url: ../api/Page/data',
>          type: 'POST',
>      dataSrc: function(json) {
>            console.log(json);
>   var names = json.columns;
>
>  
>           return json.data;
>         },
>      })
>      // or here
>      .withDataProp('data')
>         .withOption('processing', true)
>         .withOption('serverSide', true)
> .withDisplayLength(10) 
>         .withPaginationType('full_numbers');
>   
>  
>  vm.dtColumns =  $scope.col;
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to