wet-boew / wet-boew-styleguide

A style guide for the Web Experience Toolkit.
http://wet-boew.github.io/wet-boew-styleguide/index-en.html
35 stars 32 forks source link

DataTables triggered in wrong order. #413

Closed QuesnelJ closed 1 year ago

QuesnelJ commented 1 year ago

Greetings all,

I am currently getting the following warning and error in Chorm's console when using DataTables.

jQuery.Deferred exception: Cannot read properties of undefined (reading 'aria') TypeError: Cannot read properties of undefined (reading 'aria')
    at HTMLTableCellElement.<anonymous> (https://jacquesquesnel.myds.me:901/_fromExternal/_templates/WET4/wet-boew/js/wet-boew.min.js:8:157500)
    at Function.each (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:3003)
    at S.fn.init.each (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:1481)
    at HTMLDocument.<anonymous> (https://jacquesquesnel.myds.me:901/_fromExternal/_templates/WET4/wet-boew/js/wet-boew.min.js:8:157410)
    at HTMLDocument.dispatch (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:43184)
    at y.handle (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:41168)
    at Object.trigger (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:71790)
    at HTMLTableElement.<anonymous> (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:72385)
    at Function.each (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:3003)
    at S.fn.init.each (https://jacquesquesnel.myds.me:901/_fromExternal/jQuery/jQuery.min.js:2:1481) undefined

Uncaught TypeError: Cannot read properties of undefined (reading 'aria')
    at HTMLTableCellElement.<anonymous> (wet-boew.js:14416:99)
    at Function.each (jQuery.min.js:2:3003)
    at S.fn.init.each (jQuery.min.js:2:1481)
    at HTMLDocument.<anonymous> (wet-boew.js:14414:21)
    at HTMLDocument.dispatch (jQuery.min.js:2:43184)
    at y.handle (jQuery.min.js:2:41168)
    at Object.trigger (jQuery.min.js:2:71790)
    at HTMLTableElement.<anonymous> (jQuery.min.js:2:72385)
    at Function.each (jQuery.min.js:2:3003)
    at S.fn.init.each (jQuery.min.js:2:1481)

I have contacted the good folks at CloudTables (the folks who create DataTables) and they tell me:

Probably best to speak to the developer who wrote that code. You need the i18nText variable to be set up before the init.dt event occurs (since it is using i18nText in that event handler).

But init-dt is happening first - which suggests that the DataTable is being intialised before whatever is triggering timerpoke.wb.

Perhaps the issue is that timerpoke.wb is too late. But without going through all of the code, I'm not certain what the correct sequence of events should be.

I have tried pretty much every order of the following three lines I can thing of:

<script src="/_fromExternal/jQuery/jQuery.min.js"></script>
<script src="/_fromExternal/_templates/WET4/wet-boew/js/wet-boew.min.js"></script>
<script src="/_fromExternal/DataTables/js/jquery.dataTables.min.js"></script>

but nothing seems to work.

You can find my code at: http://jacquesquesnel.myds.me:900/EmployeeKeeper/test/index-en.php

Any help would be greatly appreciated.

Thanks in advance and enjoy your weekend.

QuesnelJ commented 1 year ago

Would any one be available to help me debug this issue?

ghost commented 1 year ago

Don't include <script src="/_fromExternal/DataTables/js/jquery.dataTables.min.js"></script> if your using wb-tables. As it automatically added.

I am just a volunteer on this GitHub project.
ghost commented 1 year ago

Also it best to post in https://github.com/wet-boew/wet-boew.

I am just a volunteer on this GitHub project.