Changing Data Keys after init

Changing Data Keys after init

niftybytesniftybytes Posts: 4Questions: 2Answers: 0

I have search to find a solution but I guess I'm not searching for the right thing.

$('#example').DataTable( {
    data: data,
    columns: [
        { data: 'name' },
        { data: 'position' },
        { data: 'salary' },
        { data: 'office' }
    ]
} );

I am attempting to change the data keys after I create the DataTable. If it helps I am currently using

            oTable.fnClearTable();
            oTable.fnAddData(this.get("controller.currentTableData"));

to push new data into the table but the keys have changed with the new data.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Answer ✓

    Currently no - there is no option to change the data property after initialisation. You would need to destroy the table and create a new one with the new options.

    Allan

This discussion has been closed.