DataTables / DataTables/Plugins

Cannot read property '_buttons' of undefined

Open
#408 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

All Buttons Working Fine, Except Excel Export ?Please Help.

image

library includes:

require.config({
                waitSeconds : 30,
                paths: {
                    "datatables.net": "../datatable/dataTables.min",
                     "dataTables": '../datatable/DataTables-1.10.18/js/jquery.dataTables.min',
                    "datatables.net-buttons": "../datatable/dataTables.buttons.min",
                    "datatables.net-html5": "../datatable/buttons.html5.min",
                    "datatables.net-print": "../datatable/buttons.print.min",
                    "datatables.net-Select": "../datatable/Select-1.2.6/js/dataTables.select.min",
                    "datatables.net-flash": "../datatable/Buttons-1.5.2/js/buttons.flash.min",
                    "datatables.net-jszip": "../datatable/JSZip-2.5.0/jszip.min",
                    "datatables.net-pdfmake": "https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min",
                    //"datatables.net-pdfmake": "..datatable/pdfmake-0.1.36/pdfmake.min",
                    "datatables.net-vfs_fonts": "https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts",
                    //"datatables.net-vfs_fonts": "../datatable/pdfmake-0.1.36/vfs_fonts",
                    'datetimepicker': '../Scripts/bootstrap-datetimepicker.min',
                    jquery: '../Script/js/jquery-3.3.1.min',
                    pnp: '../Script/pnp/pnpjs.es5.umd.bundle.min',
                    promise: '../Script/pnp/es6-promise.min',
                    fetch: '../Script/pnp/fetch',
                    polyfill: '../Scripts/polyfill.min',
                    RateCardDashboard: '../Scripts/RateCardDashboard',
                    bootstrapValidator: '../Scripts/bootstrapValidator',
                    dataTables: '../datatable/DataTables-1.10.18/js/jquery.dataTables.min',
                    bootstrapmin: '../Scripts/bootstrap.min',
                    jqueryconfirm: '../Content/jquery-confirm.min',
                    xlsx: '../Content/xlsx.full.min'
                },
                shim: {
                    'pnp': {
                        deps: ['promise', 'fetch', 'polyfill']
                    },
                    'RateCardDashboard': {
                        deps: ['pnp','bootstrapValidator']
                    },
                    "datatables.net": {
                        deps: ['jquery','jqueryconfirm', "bootstrapmin"]
                    }
                }
            });
            require(['xlsx',"dataTables", 'datatables.net-buttons',"datatables.net-flash", "datatables.net-jszip", "datatables.net-pdfmake", "datatables.net-vfs_fonts", "datatables.net-html5", 'datatables.net-print', "RateCardDashboard"], function (datatables, botton, html5, jszip, pdfmake) {
                    window.JSZip = jszip;
                    window.pdfmake = pdfmake;
                });

Datatable Initialize:

$('#RateCardGrid').DataTable({
                   orderCellsTop: true,
                   autoWidth: false,
                   fixedColumns: true,
                   dom: 'Bfltip',
                   "columnDefs": [{
                       "orderable": false,
                       "targets": [3, 11]
                   }, {
                       "targets": [12],
                       "visible": false,
                       "searchable": false
                   }, {
                       "targets": [13],
                       "visible": false,
                       "searchable": false
                   }
                   //    , {
                   //    "targets": [14],
                   //    "visible": false,
                   //    "searchable": false
                   //}
                       ]
                   //,
                   //"orderFixed": [0, 'asc']
               });

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RequireJS configuration and the DataTable initialization for #RateCardGrid, then reproduce the Excel export failure while checking the module dependencies and require callback. The issue is done when Excel export works without the “_buttons” undefined error; no test file is provided, so verify the behavior manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.