Topic: mdb.Datatable is not a constructor
Expected behavior
1) include mbd free (css/js), as well as mbd datatables module (css/js)
2) include: promoDatatableInstance = new mdb.Datatable(promoDatatable);
3) returns error: mdb.Datatable is not a constructor
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Open
Specification of the issue
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 3.10.0
- Device: all
- Browser: all
- OS: all
- Provided sample code: No
- Provided link: No
Dawid Wajszczuk staff commented 3 years ago
Hi. As you import only one module, did you try using
datatable
orDatatable
instead ofmdb.Datatable
. If not, can you provide the piece of code responsible for datatable's import?mmmarkk01 pro premium priority commented 3 years ago
I had the same issue, for me using datatable instead of mdb.Datatable resolved it. However it is not clear to me why this works?
Dawid Wajszczuk staff commented 3 years ago
When you import
mdb.min.js
, themdb
prefix needs to be used. But when you import datatable or other component directly, you just need to use this component's name. This component is not included in exports in free version of MDB, so it won't be available inmdb
object.