Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Implements Buttons #833

Closed
alesanfer opened this issue Aug 5, 2016 · 5 comments
Closed

Implements Buttons #833

alesanfer opened this issue Aug 5, 2016 · 5 comments

Comments

@alesanfer
Copy link

How to implements this option (buttons) with the angular-datatables?
i'm using:

vm.dtOptions = DTOptionsBuilder.fromFnPromise(function() {
    var defer = $q.defer();
    $http.get('http://localhost/test/public/read-users').then(function(result) {
        defer.resolve(result.data);
    });
    return defer.promise;
})
  .withPaginationType('full_numbers')
  .withOption('buttons',['copy', 'excel', 'pdf'])
  .withOption('createdRow', createdRow);

Thanks

@milhamj
Copy link

milhamj commented Aug 11, 2016

Having the same problem

This link actually shows it's done but there are missing scripts in the version that I'm using:

<script src="vendor/angular-datatables/dist/plugins/buttons/buttons.colVis.js"></script>
<script src="vendor/angular-datatables/dist/plugins/buttons/buttons.flash.js"></script>
<script src="vendor/angular-datatables/dist/plugins/buttons/buttons.html5.js"></script>
<script src="vendor/angular-datatables/dist/plugins/buttons/buttons.print.js"></script>

Maybe because the tutorial is not up-to-date.

UPDATE
I downloaded the sources from this link and implement it to my project. It's working fine now.
Just view-source the page, download the scripts manually, and include it to your project.

@Qasim333
Copy link

I put these missing files manually, but button still not showing for the datatable. any suggestions?

@milhamj
Copy link

milhamj commented Aug 22, 2016

Well here's what I included to my project:

'../bower_components/angular-datatables/dist/plugins/bootstrap/datatables.bootstrap.min.css'
'../bower_components/angular-datatables/dist/plugins/bootstrap/angular-datatables.bootstrap.min.js'
'../bower_components/bootstrap/dist/js/bootstrap.min.js'
'../bower_components/datatables.net-buttons-bs/css/buttons.bootstrap.min.css'
'../bower_components/datatables.net-buttons/js/dataTables.buttons.min.js'
'../bower_components/datatables.net-buttons-bs/js/buttons.bootstrap.min.js'
'../bower_components/angular-datatables/dist/plugins/buttons/angular-datatables.buttons.min.js'
'../bower_components/angular-datatables/dist/plugins/buttons/buttons.colVis.js'
'../bower_components/angular-datatables/dist/plugins/buttons/buttons.flash.js'
'../bower_components/angular-datatables/dist/plugins/buttons/buttons.html5.js'
'../bower_components/angular-datatables/dist/plugins/buttons/buttons.print.js'

PS: As you can see I use bootstrap too, but I think it should be fine without bootstrap

l-lin added a commit that referenced this issue Aug 27, 2016
@l-lin
Copy link
Owner

l-lin commented Aug 27, 2016

I updated the documentation to use the CDN instead.

@alesanfer
Copy link
Author

Thanks!

l-lin added a commit that referenced this issue Sep 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants