Example doesn't work (Standalone-> Inline editing)

Example doesn't work (Standalone-> Inline editing)

BoinikBoinik Posts: 12Questions: 2Answers: 0

https://editor.datatables.net/examples/standalone/inline.html

Uncaught TypeError: Cannot read property '0' of undefined
at a.dc [as _inline] (dataTables.editor.min.js:68)
at dataTables.editor.min.js:43
at dataTables.editor.min.js:64
at a.Xb [as _event] (dataTables.editor.min.js:64)
at dataTables.editor.min.js:63
at a.Xb [as _event] (dataTables.editor.min.js:64)
at a.Wb [as _edit] (dataTables.editor.min.js:63)
at a.mb [as inline] (dataTables.editor.min.js:43)
at HTMLElement.<anonymous> (inline.html:71)
at HTMLElement.dispatch (jquery-3.5.1.js:5429)

Error in the console on the example page. Please tell me how to fix

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Answer ✓

    Hi,

    Sorry about that error - we missed that bug in Editor 2. I'll drop 2.0.2 with the fix for it next week. Until then, if you search the dataTables.editor.js file for:

            $.each( out, function ( id, set ) {
                set.type = 'cell';
                set.attach = attachEl ?
                    $(attachEl) :
                    __html_els( identifier, fieldNames ).toArray();
                set.fields = fields;
                set.displayFields = forceFields;
            } );
    

    and replace with:

            $.each( out, function ( id, set ) {
                set.type = 'cell';
                set.attachFields = [fieldNames];
                set.attach = attachEl ?
                    $(attachEl) :
                    __html_els( identifier, fieldNames ).toArray();
                set.fields = fields;
                set.displayFields = forceFields;
            } );
    

    That will fix it.

    Allan

  • BoinikBoinik Posts: 12Questions: 2Answers: 0

    Many thanks

This discussion has been closed.