============================UPDATED 1.1============================

I'm new to Magento 2.3, I'm trying to apply jQuery DataTable(DONE), after than, I want to add it's Button Extension, for that i need to add two more js, i did, now my Js file in included but can't see print button, Here is my code:


 var config = {
    map: {
   '*': {
       dataTables: 'EC_Downloads/js/datatables.min'


require(['jquery', 'jquery/ui','dataTables'], function($){ 
            dom: 'Bfrtip',
            buttons: [

Initializing other two js button.js, button_print.js like this:

<script type="text/x-magento-init">
        "*": {

Getting This Error: enter image description here

  • Have you done setup upgrade, static-conetent deploy and cache flush? – Rutvee Sojitra May 28 '19 at 10:40
  • i didn't do upgrade as i think its not necessary, but did sudo rm -rf var/ pub/static/adminhtml generated/ sudo php bin/magento setup:di:compile, sudo php bin/magento setup:static-content:deploy -f & Clean Flush.... – Partab Saifuddin Zakir May 28 '19 at 10:43
  • still your file not included? – Rutvee Sojitra May 28 '19 at 10:45
  • Nope, No Js in Network.... – Partab Saifuddin Zakir May 28 '19 at 10:47
  • i cant see how you use dataTables ? – fmsthird May 28 '19 at 11:02

I've used dataTables before in frontend theme. Not that different to what you have tried. Just for clarity here's what I ended up with.

require(['jquery', 'jquery.dataTables'], function($, DataTable) {


        "jquery.dataTables": "Magento_Theme/js/jquery.dataTables.min"

Location of file


Worked for me.

  • Bro @DominicXiegen dataTable is working for me, the problem is i just want to add Button Extention https://www.datatables.net/extensions/buttons/examples/initialisation/simple.html which is not working..... – Partab Saifuddin Zakir May 29 '19 at 3:31

Try to replace your <script> tag with below code

<script type="text/x-magento-init" />

Refer: https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/javascript/js_init.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.