Comments (4)
you could add them with
bower install --save datatables.net-buttons
bower install --save datatables.net-buttons-dt
reference: https://datatables.net/download/bower
it should save the files on bower_components, and should be automatically added on the vendor.js,
if it's not loading correct files you could override settings on /tasks/bower.task.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
https://github.com/l-lin/angular-datatables
from laravel-angular-admin.
Ha! You're a great help!
It's working perfectly.
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
.withButtons([
'columnsToggle',
'colvis',
'copy',
'print',
'excel',
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
])
Like described in the documentation on https://l-lin.github.io/angular-datatables/#/withButtons
There's no need to add extra arguments to the constructor of your component, works like a charm.
from laravel-angular-admin.
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
angularjs-pass-argument-to-directive
from laravel-angular-admin.
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:
angular.module('app.components', [
'ui.router', 'angular-loading-bar',
'restangular', 'ngStorage', 'satellizer',
'ui.bootstrap', 'chart.js', 'mm.acl', 'datatables' ])
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.
from laravel-angular-admin.
Related Issues (20)
- Karma not working with NgDescribe HOT 2
- can't login when run project HOT 2
- Cannot set property 'error' of undefined HOT 2
- Google Login Functionality
- Datatables pagination server side HOT 2
- The project are not going to run. where are problem ?? HOT 1
- Edit angular page/ component not work HOT 1
- which angularjs generator do you use?
- Role problem HOT 1
- Is this project still alive? HOT 2
- Bower Unexpected String in JSON at position 470
- unable to add new crud HOT 2
- gulp && gulp watch dont works
- How to activate new modules in it HOT 1
- file_get_contents(/Users/../build/rev-manifest.json HOT 3
- Laravel 5.2 + Dingo + JWT - Multiple Auth with different prefixes
- cannot register or login HOT 2
- installation error in localdevelopment HOT 3
- npm install error
- TypeError: Cannot read property 'message' of undefined On Login HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-angular-admin.