Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: mdb.Datatable is not a constructor

Darryl free asked 3 years ago


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


Dawid Wajszczuk staff commented 3 years ago

Hi. As you import only one module, did you try using datatable or Datatable instead of mdb.Datatable. If not, can you provide the piece of code responsible for datatable's import?


mmmarkk01 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, the mdb 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 in mdb object.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: 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
Tags