Plugins usage and documentation #3788
-
From what I understand installing adminlte via NPM includes plugins like datatables. However it's not clear exactly how to include and use them in, for example, a laravel project. Is there something I'm missing here? I know datatables has documentation for installing it standalone via NPM but specifically using what is included with adminlte is a mystery to me. What do I need to add to my app.js and app.scss to make these plugins work? The adminlte documentation includes a page showing datatables working but does not explain how to configure it to work without a CDN. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After some trial and error I think I figured it out. The following will be using Datatables and some of its extensions that I'm using in a Laravel 7 project. In resources/js/app.js: // AdminLTE In resources/sass/app.scss: // AdminLTE Basically import all scss files for the plugin in app.scss and require all js files in app.js. Check node_modules/admin-lte/plugins for file paths necessary for the plugin you want to use. |
Beta Was this translation helpful? Give feedback.
After some trial and error I think I figured it out. The following will be using Datatables and some of its extensions that I'm using in a Laravel 7 project.
In resources/js/app.js:
`
// Bootstrap
require('./bootstrap');
// AdminLTE
require('admin-lte');
require('admin-lte/plugins/datatables-bs4/js/dataTables.bootstrap4');
require('admin-lte/plugins/datatables-select/js/select.bootstrap4');
require('admin-lte/plugins/datatables-scroller/js/scroller.bootstrap4');
require('admin-lte/plugins/datatables-buttons/js/buttons.bootstrap4');
require('admin-lte/plugins/datatables-buttons/js/buttons.colVis.js');
require('admin-lte/plugins/datatables-buttons/js/buttons.html5.js');
require('admin-lte/p…