How to fix “Cannot set property '_aData' of undefined” with DataTables plugin?

How to fix “Cannot set property '_aData' of undefined” with DataTables plugin?

SebCollardSebCollard Posts: 8Questions: 4Answers: 0
edited August 2019 in Free community support

I use DataTables plugin to make a table and in this table I would like to add the posibilty to edit a cell. Therefore I add 'altEditor' option with all necessary include but when I want to change a variable in the table, the editor page notify the success of the change but the variable doesn't change and I have this error :'Cannot set property '_aData' of undefined' and I don't know why.

For altEditor I use this : altEditor

JS :

function make_table(data_table) {
    var name = get_name_layer();
    var data_use = get_data_table(data_table);
    var column_name = [{
        title : name
    }, {
        title : title_surf
    }, {
        title : title_prod
    }, {
        title : title_yield
    }];
    $('#datatable').DataTable({ 
        "sPaginationType" : "full_numbers",
        data : data_use,
        columns : column_name,
        dom : 'Bfrtip',
        select : 'single',
        responsive : true,
        altEditor : true,
        destroy : true,
        searching: true,
        buttons : [{
                extend : 'selected',
                text : 'Edit',
                name : 'edit',
        }],
    });
}

HTML :

<div id = "datatablecontainer" class = "boxsharpy col-lg-7 col-md-4 col-xs-12">
        <table class = "display" id = "datatable"></table>
</div>

Answers

  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin

    I'm afraid that altEditor is not supported by us. You'd need to ask the author of that plug-in.

    Allan

  • SebCollardSebCollard Posts: 8Questions: 4Answers: 0

    I found the problem, on this line 13 it's necessary to write 'dataTables' with a lower 'd', like this : $('#datatable').dataTable({});

This discussion has been closed.