Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3744

key example inline editing gives error

$
0
0

Hi all
I am trying out the example in :
https://datatables.net/reference/event/key

Wheninline(cell) is called I always get the following error:
Uncaught TypeError: Cannot read property 'contents' of undefined

Here is my code based on the example above:

        var expensesDataTable = initOtherExpensesTable(); // KeyTable enabled

        expensesDataTable.on('key', function (e, datatable, key, cell, originalEvent) {
            if (key === 13) {
                console.log('return key pressed');
                expensesEditor
                    .one( 'close', function () {
                        expensesDataTable.keys.enable();
                    } )
                    .inline( cell );

                expensesDataTable.keys.disable();            }
        });

Here is the code causing the problem (last line of snippet below) :

        this._edit(a, k, "inline", c, function() {
            var a = e._formOptions(c);
            if (!e._preopen("inline"))
                return e;
            var b = g.contents().detach();

Has anyone got this example working ?
Any ideas what might be wrong ?

Regards,
Ronald Wouters


Viewing all articles
Browse latest Browse all 3744