question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

withButtons is not a function

See original GitHub issue

Hi there

I started working with the buttons plugin but I can’t seem to make it work even after including almost all the files inside the plugins folder. Below are the files that I’ve imported into my page: <script src="/bower_components/datatables.net/js/jquery.dataTables.min.js"></script> <script src="/bower_components/datatables.net-buttons/js/dataTables.buttons.min.js"></script> <script src="/bower_components/angular-datatables/dist/angular-dataTables.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/buttons/angular-datatables.buttons.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/colvis/angular-datatables.colvis.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/colreorder/angular-datatables.colreorder.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/columnfilter/angular-datatables.columnfilter.min.js"></script>

And below is how I used it in my app.js: $scope.dtOptions = DTOptionsBuilder.newOptions().withButtons(['pdf']);

But whenever I refresh my screen, I get the following error: angular.js:13920 TypeError: DTOptionsBuilder.newOptions(...).withButtons is not a function

Below are the versions of each component: “angular-datatables”: “~0.5.4”, “datatables.net”: “~1.10.12”, “datatables.net-buttons”: “~1.2.2”

I would greatly appreciate any help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ichegithubcommented, Aug 17, 2016

Closing this issue as it was more of a coding error. Missed adding datatables.buttons in my angular app

0reactions
InventTamilselvancommented, Nov 12, 2018

how u added the datables.buttons in your angular app ,iam trying to adding it shows error var controllerId = ‘YearlyReportsDashBoard’; angular .module(‘IOCApp’) .controller(controllerId, YearlyReportsDashBoard);

YearlyReportsDashBoard.$inject = ['$scope', '$window', 'DTColumnBuilder', 'DTOptionsBuilder', 'common', 'viewModel'];

function YearlyReportsDashBoard($scope, $window, DTColumnBuilder, DTOptionsBuilder, common, viewModel)

Above code is for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angularjs - .withButtons() is not a function - Stack Overflow
Am trying to export my datatable into excel or csv but when I use .withButtons(), I get an error saying its not a...
Read more >
Function view with buttons for car functions | Centre display
Most buttons in function view are function buttons. Trigger buttons. Do not have on/off positions. When a trigger button is pressed, a window...
Read more >
Custom button - DataTables example
The Javascript shown below is used to initialise the table shown in this example: $(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', ...
Read more >
react-alert-with-buttons - npm
Start using react-alert-with-buttons in your project by running `npm i ... If you have not installed them, please install them by.
Read more >
Using functions with buttons - Raspberry Pi Forums
Sorry I probably should have made it more clear - the 2nd block of code I posted works fine, that's how I know...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found