OnPageDisplay Plugin throwing Error on DataTables 2 and Editor 2.3

OnPageDisplay Plugin throwing Error on DataTables 2 and Editor 2.3

ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2
edited February 16 in Editor

The original blog post for the OnPageDisplay (https://datatables.net/blog/2017-06-30) has an error as well, however it's different than the error I'm getting.

Error on the blog is (an older blog so I'm guessing something else is off on this one):

Uncaught TypeError: e.apply is not a function

Error I'm receiving on my page is:

Uncaught TypeError: this.s.displayController.node is not a function
    at Editor.displayNode (dataTables.editor.js:2268:37)
    at Field.hide (dataTables.editor.js:5834:48)
    at String.<anonymous> (dataTables.editor.js:2398:23)
    at Function.each (jquery-3.6.3.js:385:19)
    at Editor.hide (dataTables.editor.js:2397:7)
    at String.<anonymous> (dataTables.editor.js:2148:26)
    at Function.each (jquery-3.6.3.js:385:19)
    at update (dataTables.editor.js:2146:11)
    at HTMLDivElement.<anonymous> (dataTables.editor.js:2189:21)
    at HTMLDivElement.dispatch (jquery-3.6.3.js:5494:27)

Seems related to hiding a field inside dependent, but this hasn't popped up on other Editor instances that use a standard modal

I'll try to create a test page if I can. I tried to copy the latest plugin code from (https://editor.datatables.net/plug-ins/display-controller/editor.onPage#Plug-in-code) and I get the same error.

This worked previously on DataTables 1.13 and Editor 2.2 and nothing else on the page has changed.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Interesting! Editor 2.3.0 hasn't changed much in that regard. I'll look into this and let you know.

    Allan

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

    Thanks @allan

    Look forward to what you find out, I haven't been able to figure out the issue.

    Tried to create a pretty simple test case...but it's angry about something else, so it's not the most helpful, but here it is nonetheless:

    https://live.datatables.net/reqotuyi/1/edit

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

    I got my test case working now (forgot the "select" extension was required):

    https://live.datatables.net/reqotuyi/3/edit

    The error is visible in the console and is similar to what I am receiving. Triggers when doing a dependent show/hide within the OnPageDisplay.

  • jacob.steinbergerjacob.steinberger Posts: 86Questions: 18Answers: 1
    edited February 23

    I also encounter the same error on the blog post, but oddly, not in my own implementation. I am however running into ugly CSS issues after the update, related to the onPage css changes.

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

    Hey @allan ,

    Just wanted to make sure this was still on your radar. I am sure 2.0 has been pretty busy :)

    Thanks

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    It is on the agenda for today in fact :)

    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited February 29

    I've updated the blog post. The only change was to update the version of Select being used, since the version on the page wasn't compatible with DataTables 2.

    If you are still having issues with it (I don't know why you would have been getting the error you did), I'd need a link to your page showing the issue please.

    Allan

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

    Hi @allan ,

    Thanks for the follow up.

    Here's a test case showing the issue. Relates to show/hide of a field when using dependent with the on page display:

    https://live.datatables.net/reqotuyi/5/edit

    Attempting to create a new record will trigger the error. It's the same one I am getting :)

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Interesting - thanks for that. If I add a node method to the display controller, it then works: https://live.datatables.net/reqotuyi/8/edit .

    I must have tweaked something that requires that!

    I'll add it to the blog post as well.

    Allan

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

    Thanks as always @allan !

    That is now working on my page as well

Sign In or Register to comment.