DataTables / DataTables/Plugins
Cannot read property '_buttons' of undefined
Open
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.

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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