Uncaught TypeError: dt[T4b] is not a function

Uncaught TypeError: dt[T4b] is not a function

gaafgaaf Posts: 3Questions: 1Answers: 0
edited January 2020 in Free community support

Hi,

Is there anyone who knows where the error is coming from?
I implemented the editor for Datatables, but when I click upon a cell my console gives me an error on every keydown or click.

Uncaught TypeError: dt[T4b] is not a function
at __dtCellSelector (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:49752)
at Editor.individual (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:49752)
at Editor.<computed>.<computed> [as _dataSource] (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:49752)
at Editor.<computed>.<computed> [as inline] (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:49752)
at HTMLTableCellElement.<anonymous> (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:173784)
at HTMLTableElement.dispatch (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:103087)
at HTMLTableElement.elemData.handle (gaaf_theme_app.js?id=0abb15b9028bf9b96b35:102894)

Answers

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    What version of DataTables are you using? If not 1.10.20 (current release) it would be worth updating.

    If its not that, could you give me a link to the page so I can debug it please?

    Thanks,
    Allan

  • gaafgaaf Posts: 3Questions: 1Answers: 0

    @allan
    I'm using datatables 1.10.20 with the following:

    window.$.fn.DataTable = require("datatables.net");
    require("datatables.net-bs4");
    require("datatables.net-autofill");
    require("datatables.net-autofill-bs4");
    require("datatables.net-buttons-bs4");
    require("datatables.net-buttons/js/buttons.print.js");
    require("datatables.net-buttons/js/buttons.html5.js");
    require("datatables.net-buttons/js/buttons.flash.js");
    require("datatables.net-buttons/js/buttons.colVis.js");
    require("datatables.net-colreorder-bs4");
    require("datatables.net-fixedcolumns-bs4");
    require("datatables.net-fixedheader-bs4");
    require("datatables.net-keytable-bs4");
    require("datatables.net-responsive-bs4");
    require("datatables.net-rowgroup-bs4");
    require("datatables.net-rowreorder-bs4");
    require("datatables.net-scroller-bs4");
    require("datatables.net-select-bs4");
    require('datatables.net-editor-bs4');

    When I add the editor package through: require('datatables.net-editor-bs4');
    I'm getting the following console error:

    Uncaught TypeError: Cannot read property 'defaults' of undefined
    at gaaf_theme_app.js?id=3be2f391a5cdb34376c4:49801
    at Object.<anonymous> (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:49788)
    at gaaf_theme_app.js?id=3be2f391a5cdb34376c4:49789
    at Object../node_modules/datatables.net-editor-bs4/js/editor.bootstrap4.js (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:49793)
    at webpack_require (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:20)
    at Object../resources/gaaf_theme/tools/webpack/vendors/custom/datatables.js (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:185126)
    at webpack_require (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:20)
    at Module../resources/js/gaaf_theme_app.js (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:185397)
    at webpack_require (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:20)
    at Object.1 (gaaf_theme_app.js?id=3be2f391a5cdb34376c4:185418)

    This exception is coming from the editor package:

    var DataTable = $.fn.dataTable;
    /*
    * Set the default display controller to be our bootstrap control
    */
    DataTable.Editor.defaults.display = "bootstrap";

    /*
    * Alter the buttons that Editor adds to TableTools so they are suitable for bootstrap
    */
    var i18nDefaults = DataTable.Editor.defaults.i18n;
    i18nDefaults.create.title = '

    '+i18nDefaults.create.title+'

    ';
    i18nDefaults.edit.title = '

    '+i18nDefaults.edit.title+'

    ';
    i18nDefaults.remove.title = '

    '+i18nDefaults.remove.title+'

    ';

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Could you link to your page, as Allan asked, please. Without seeing it, it's hard to debug.

    Colin

  • gaafgaaf Posts: 3Questions: 1Answers: 0

    I sent Allan an email with the details, because it's a private protected application :)

This discussion has been closed.