Unable to get property 'oFeatures' of undefined or null reference error

Unable to get property 'oFeatures' of undefined or null reference error

seiser01seiser01 Posts: 17Questions: 9Answers: 0

I'm attempting to add inline editing to an existing DataTable editor instance. When I run it and click on a cell in the table, I get the following error which occurs on line 3 below:

Unable to get property 'oFeatures' of undefined or null reference error

// Activate an inline edit on click of a table cell
$('#tblEditGoalObs').on( 'click', 'tbody td:not(:first-child)', function (e) {
    editor.inline( this );
} );


oDT =  $('#tblEditGoalObs').DataTable( {
    dom: "Bfrtip",
    data: $.map( oObs2, function (value, key) {
        var junk = key;
        return value;
    } ),
    columns: aoObsColumns,
    select: {
        style:    'os',
        selector: 'td:first-child'
    },        
    buttons: [
        { extend: "create", editor: obs_editor },
        { extend: "edit",   editor: obs_editor },
        { extend: "remove", editor: obs_editor }
    ]
} );

// End of Set up the editor ***********************************

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922
    Answer ✓

    Looks at your buttons config:

        buttons: [
            { extend: "create", editor: obs_editor },
            { extend: "edit",   editor: obs_editor },
            { extend: "remove", editor: obs_editor }
        ]
    

    It looks like the variable for your Editor instance is obs_editor. You should use obs_editor.inline( this ); instead.

    Kevin

  • seiser01seiser01 Posts: 17Questions: 9Answers: 0

    Well, that would make sense. :s

    Thank you Kevin

This discussion has been closed.