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: Js error: TableEditor is not defined

De Berardinis free asked 3 years ago


Hello.I'm trying to use your Table-editor Plugin version 4.8.11. Following your documentation I have created this script:

$(document).ready(function () {
    const datiColonne = [  {
"width": 180,
"label": "GRUPPO",
"field": "GRUPPO",
"sort": true,
"inputType": "select",
"defaultValue": null,
"options": {
  "0001": "EDUCATIVI PRESCOLARI",
  "0002": "EDUCATIVI ELETTRONICI",
  "0005": "GIOCHI CREATIVI",
  "0006": "GIOCHI DI SOCIETÀ",
  "0007": "PUZZLE PER BAMBINI",
  "0019": "ALTRI PRODOTTI",
  "0024": "ANIMALI DA COLLEZIONE"    }  }];
    const datiRighe = [{"GRUPPO":"EDUCATIVI PRESCOLARI"}];
    const dataTableEdit = new TableEditor($('#boxGriglia'), { columns: datiColonne, rows: datiRighe }, {
        fixedHeader: true, mode: 'inline', pagination: false, striped: true
    });
});

I have included in the page header the css files in this sequence (v. Min):

  • bootstrap
  • mdb
  • myCustomCss
  • datatable
  • table-editor

at the end of the page I have included the following scripts (* .js):

  • jquery
  • popper
  • bootstrap
  • mdb
  • datatable
  • mdb-editor-es6

When I recall the page I get an error js TableEditor is not defined.

Where am I doing wrong? Thank you


De Berardinis free answered 3 years ago


Below is a link to a sample snippet:

snippet

The reference of the documentation is this: doc


Marcin Luczak staff commented 3 years ago

Hello @De Berardinis,

Which MDB Package are you using - MDB5-Standard or MDB4-jQuery. I can see that you are including jQuery, Popper and Bootstrap as you would normally do in MDB4 package but your syntax for Table Editor is from MDB5. Mixing files between MDB4 and MDB5 packages is not supported. Syntax for the jQuery version of Table Editor you can find here https://mdbootstrap.com/docs/b4/jquery/plugins/table-editor/

Regards, Marcin


De Berardinis free commented 3 years ago

Thanks for the tip. From what I see in the documentation for version 4 it is not possible to have a select as input in row edit mode? Thank you


Marcin Luczak staff commented 3 years ago

You can manually add a select element inside the <td> element, but as this functionality is not included in our specification you would have to manage the select on your own depending on what you want to achieve.

Regards, Marcin



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.2
  • Device: PC
  • Browser: Chrome
  • OS: Win10
  • Provided sample code: No
  • Provided link: No