Topic: Uncaught type error in datatables

leslieonline free asked 3 years ago


Expected behavior I can use multi-select on a datatable, by following this example: https://mdbootstrap.com/docs/b4/jquery/tables/datatables/

Actual behavior I get the following error in the browser Uncaught TypeError: o is undefined e datatables-select2.js:60 datatables-select2.js:52 datatables-select2.min.js:1 Webpack 5 datatables-select2.js:60 e datatables-select2.js:60 datatables-select2.js:52 datatables-select2.min.js:1 Webpack 5 n n


leslieonline free commented 3 years ago

Here's my js code: $(document).ready(function () { var table = $('#dtBasicExample').dataTable({ "paging": true, "pageLength": 10 , "order": [[ 13, "asc" ]], "columnDefs": [ { "orderable": false, "className": 'select-checkbox', "targets": [ 0 ]
}, { "targets": [ 9 ], "visible": false, "searchable": true }, { "targets": [ 10 ], "visible": false, "searchable": true }, { "targets": [ 11 ], "visible": false, "searchable": true }, { "targets": [ 12 ], "visible": false, "searchable": true }, { "targets": [ 13 ], "visible": false, "searchable": true }, ], select: { style: 'multi', selector: 'td:first-child' } });


leslieonline free answered 3 years ago


I'm not sure what I changed, but this has suddenly started working - please ignore :-)


Marcin Luczak staff commented 3 years ago

Hi,

I'm glad you've managed to fix that :)

Regards, Marcin


FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.2
  • Device: Laptop
  • Browser: Firefox
  • OS: Linux
  • Provided sample code: No
  • Provided link: Yes