dynamic table:Object doesn't support property or method 'DataTable'

dynamic table:Object doesn't support property or method 'DataTable'

jillian_0810jillian_0810 Posts: 6Questions: 2Answers: 0
edited May 2020 in Free community support

Link to test case: http://live.datatables.net/wepebube/1/edit
Debugger code (debug.datatables.net):
Error messages shown: SCRIPT438: SCRIPT438: Object doesn't support property or method 'DataTable'
Description of problem:
Hi, everyone. I am a new user of DataTable. I have a question about using dynamic data structure to store records and implement Datatable() method. The link to test case might seem weird since it's not printing the data entries. It is because the entries are stored in a data structure dict_view. The columns are store in dict_view['columns'] and values are stored in dict_view['value']. Here is what the actual look in my local computer.

However, when I implement the datatable() method, an error popped up, saying the object does not support the method datatable(). Then I tested the datatable() method, but changed the input table into some hard-coded entries. The same error showed up. Hence, The data structure itself does not prevent the method from working.

I read the articles in the forum about the problem and I tried the solutions. The most mentioned potential problem might be the multiple loading of jQuery. Then I removed the downloaded libraries and loaded it again but it did not work. Hence I think there might exist some limitations that disallow the datatable() method to work. If anyone have idea of this, please share with me your solution. It would be very helpful :D

And one thing interesting is the datatable() method worked before in another branch with less features. Here is how it worked before. The two branches are using the same data structure so I think it should have worked.

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770
    Answer ✓

    Your test case doesn't exhibit the same issue so its hard to say. If you can't post a link to your page or a test case showing the issue then try the debugger and provide the code for the developers to look at.

    Kevin

  • jillian_0810jillian_0810 Posts: 6Questions: 2Answers: 0

    Hi, Kevin
    Thank you for your reply! I have used the debugger and the debugger returned me this following errors:

    SCRIPT5007: SCRIPT5007: Unable to get property 'length' of undefined or null reference
    debug.js (1,8915)

    SCRIPT438: SCRIPT438: Object doesn't support property or method 'ajax'
    debug.js (1,14676)

    SCRIPT5007: SCRIPT5007: Unable to get property 'FixedHeader' of undefined or null reference
    debug.js (1,21861)

    Thanks.

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770
    Answer ✓

    Did you click the link in my previous post?
    http://debug.datatables.net/

    Kevin

  • jillian_0810jillian_0810 Posts: 6Questions: 2Answers: 0
    edited May 2020

    Hi, Kevin

    Yes, I did clicked the link you provided and add the following code into my branch.
    var n = document.createElement('script');
    n.setAttribute('language', 'JavaScript');
    n.setAttribute('src', 'https://debug.datatables.net/debug.js');
    document.body.appendChild(n);
    The problem is that the debugger showed up. But if you clicked on each feature, would return some errors as I posted in my comment.


    By clicking the feature "check table info", returns "SCRIPT5007: SCRIPT5007: Unable to get property 'length' of undefined or null reference"

    By clicking feature "version check", returns 0: Object doesn't support property or method 'ajax'

    By clicking feature "check for common issues" , returns 0: Unable to get property 'FixedHeader' of undefined or null reference.

    I am not sure why this happened. Maybe datatable() is not supported?

    Thanks again for your quick reply! :)

    Jillian

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394
    Answer ✓

    You don't incorporate the debugger link into your code.
    You follow the link, starting from a page showing your table, and then upload the configuration for the developers to interpret.

  • jillian_0810jillian_0810 Posts: 6Questions: 2Answers: 0

    Hi, Tangerine

    Thank you for your reply. I am uploading the configuration for the developers to interpret. Thanks!

  • colincolin Posts: 15,144Questions: 1Answers: 2,586
    Answer ✓

    You'll also need to send us the code for us to find it. What would help the most is if you could update that example to demonstrate the issue, or link to a page that does. Without seeing, it'll be hard to debug.

    Colin

  • jillian_0810jillian_0810 Posts: 6Questions: 2Answers: 0

    Hi,
    Thank you for all your help, Colin, Kevin, Tangerine.
    I have found the issue that prevents the datatable() method from working! The problem is my teammate included jQuery in another file but I did not notice that. Then I removed the repeated one and find it working as before!

    Thanks again for helping me out

This discussion has been closed.