Closed Manya-92 closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to inactivity. Please feel free to re-open the issue to add new inputs.
Am getting .withButtons is not a function error while am trying to export my datatable in to excel sheet.I have added the following dependencies
And my html is something like below <table datatable width="100%" class="table table-striped table-hover dtr-inline" id="example" role="grid" aria-describedby="{{message}}" dt-options="dtOptions" dt-column-defs="getColumnDefs(category)" dt-instance="dtInstanceCallback"
And my columns are defined as below
$scope.dtColumnDefs = { open: [ DTColumnDefBuilder.newColumnDef(1).notSortable(), DTColumnDefBuilder.newColumnDef(2).notSortable(), DTColumnDefBuilder.newColumnDef(5).notSortable(), DTColumnDefBuilder.newColumnDef(6).notSortable(), DTColumnDefBuilder.newColumnDef(7).notSortable() ], closed: [ DTColumnDefBuilder.newColumnDef(1).notSortable(), DTColumnDefBuilder.newColumnDef(2).notSortable(), DTColumnDefBuilder.newColumnDef(5).notSortable(), DTColumnDefBuilder.newColumnDef(8).notSortable(), DTColumnDefBuilder.newColumnDef(9).notSortable(), DTColumnDefBuilder.newColumnDef(10).notSortable(), DTColumnDefBuilder.newColumnDef(11).notSortable(), DTColumnDefBuilder.newColumnDef(12).notSortable() ] }
And my controller.js code is
angular.module('pe2eApp') .controller('DataViewCtrl', function ($scope, $state, $filter, sharedServices, DTOptionsBuilder, DTColumnBuilder, DTColumnDefBuilder, $q, $stateParams, $sce, $interval, $uibModal) { $scope.dtOptions = DTOptionsBuilder.newOptions() .withPaginationType('full_numbers') .withDOM('Blrtip') .withButtons([{ title : 'liveissues', text:'Export To CSV', exportOptions: { columns:[1,2,5]}
}
]);
Kindly let me know where I have gone wrong . Have been stuck here