-
Notifications
You must be signed in to change notification settings - Fork 415
Adding datatables.buttons #52
Comments
Hi, not sure if i got the question right, but if the question is where to put button functionality it should be on the controller of datatables.buttons, and im assuming you created a new component or perhaps directive datatables.buttons you have to make it a little more flexible and allow passing of parameters on it to make it reusable, check the url below regarding this |
Hi Silverbux, Thanks for the quick reply. I think there's a little hickup in the communication. I'll try to explain the situation. I have the datatables plugin working (because it's standard in this repo, thanks for that :) ) - and it's added into index.modules.js as so: To use it in my controller I added the 'DTOptionsBuilder, DTColumnBuilder' directives in the constructor, which is working fine. But now I wanted to use the button functionality as well, and I added 'datatables.buttons' into the modules array. This works because the datatables.buttons is included in the angular datatables package. So far so good. But now I need to use it in the controller. So for that I just add .withButtons to my datatables instance. No errors, but no buttons either. So I read on the angular-datatables page (https://l-lin.github.io/angular-datatables/#/withButtons) that I need to include the additional JS files as well.... but now my question is, where to add this? Or do I need to include the contents of those files into the big vendor.js (root/public/js/vendor.js) file? Hope this shows the underlying problem I have atm. |
you could add them with
reference: https://datatables.net/download/bower it should save the files on bower_components, and should be automatically added on the vendor.js, your last resort would be adding it on resources/views/index.blade.php though i don't really recommend this one. though i haven't really tried this, not really sure how angular-datatables implemented / supported extensions. you might want to consult as well |
Ha! You're a great help! So for anyone else that wants to use these handy features, do as @silverbux mentioned in the above post and then in your datatables instance add
Like described in the documentation on https://l-lin.github.io/angular-datatables/#/withButtons |
Hi,
I'm trying to use the buttons on the datatables.
I added 'datatables.buttons' to the index.modules.js and the .withButtons option on creating the Datatable.
Now I know I need to add the additional js files for the DT buttons functionality.... but WHERE? :)
Please help me out, I think this is useful for others as well as I spent a few hours Googling it without luck :(
The text was updated successfully, but these errors were encountered: