Error (TypeError: this[q1U] is not a function) when clicking edit button

Error (TypeError: this[q1U] is not a function) when clicking edit button

CookzCookz Posts: 3Questions: 1Answers: 0

So I've downloaded the editor trial for my project since the default dataTables has been working perfectly.
Displaying data works fine but when clicking on the edit/delete button I receive the following error.

TypeError: this[q1U] is not a function dataTables.editor.js:21:171833
I've adjusted one of the examples on the site.

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
    ajax: {
            url: "data.php",
            type: "POST"
        },
        "table": "#dtScores",
        "fields": [ {
                "label": "ID:",
                "name": "id"
            }, {
                "label": "First name:",
                "name": "firstname"
            }, {
                "label": "Last name:",
                "name": "name"
            }, {
                "label": "Place:",
                "name": "place"
            }, {
                "label": "Class:",
                "name": "class"
            }, {
                "label": "Team:",
                "name": "team"
            }, {
                "label": "Time:",
                "name": "time"
            }, {
                "label": "Year:",
                "name": "year"
            }
        ]
    } );
  
    $('#dtScores').DataTable( {
        dom: 'lBfrtip',
        ajax: {
            url: "data.php",
            type: "POST"
        },
        'processing': true,
        'serverMethod': 'post',
        language: {
            //url: '//cdn.datatables.net/plug-ins/1.10.20/i18n/Norwegian-Nynorsk.json'
        },
        "lengthMenu": [ [15, 30, 50, 100, 250, 500, 1000, 1500], [15, 20, 50, 100, 250, 500, 1000, 1500] ],
        "iDisplayLength": 15,
        serverSide: true,
        columns: [
                    { data: 'id', type: "readonly" },
                    { data: 'firstname', type: "readonly" },
                    { data: 'name', type: "readonly" },
                    { data: 'place' },
                    { data: 'class' },
                    { data: 'team' },
                    { data: 'time' },
                    { data: 'year' }
        ],
        select: true,
        buttons: [
            //{ extend: "create", editor: editor },
            { extend: "edit",   editor: editor },
            { extend: "remove", editor: editor }
        ]
    } );
} );

HTML

<table id='dtScores' class="table table-hover table-bordered" cellspacing="0" width="100%">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>Firstname</th>
                    <th>Name</th>
                    <th>Place</th>
                    <th>Class</th>
                    <th>Team</th>
                    <th>Time</th>
                    <th>Year</th>
                </tr>
                </thead>
                 
            </table>

I'm also a bit lost on how I now get the edited data into my php file. I assume this is a POST request and the rowdata gets pushed.

For this I tried the steps in diagnostics (https://datatables.net/manual/tech-notes/12#Diagnosis) but it doesn't send an ajax request yet due to the error above.

Anyone has any ideas where I went wrong?

edit: not sure what just happened but my first discussion was gone all of a sudden?
If I broke the rules somehow please let me know.
I'll try to add a jsfiddle / bin when I get home

Answers

  • CookzCookz Posts: 3Questions: 1Answers: 0

    Ran the debugger. No issues were found. Updated to all the latest versions.
    Now my error has changed.

    uncaught exception: Unable to find row identifier For more information, please refer to https://datatables.net/tn/14
    

    I'll check this out first. Will get back to you all!

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    That error would suggest it couldn't find the Editor files - is it present on the page?

    Colin

  • CookzCookz Posts: 3Questions: 1Answers: 0

    The "idSrc" parameter did the trick for me when dealing with my last error above.
    Working fine now!

This discussion has been closed.