columns is undefined

columns is undefined

MindaugasMindaugas Posts: 1Questions: 1Answers: 0
edited May 2014 in DataTables 1.10

Hello,

I'm just going crazy with new DataTables version, so maybe somone can help me.

So, I have:

var materialsTable = $(".timeMaterialsTable").dataTable({
        language: {
            url: BASEURL + 'assets/js/app/language/lithuanian/datatable.json'
        },
        scrollCollapse: true,
        searching: false,
        paging: false,
        columns: [
            { width: "1%" },
            { width: "60%" },
            { width: "5%" }
        ]
});

After showing Bootstrap modal, I'm trying to adjust columns:

$("#timeMaterialsDialog").modal('show');
console.log(materialsTable);
materialsTable.columns.adjust().draw();

But get, no idea why,error in Firebug:

Object[table#DataTables_Table_0.timeMaterialsTable] // console.log();

TypeError: materialsTable.columns is undefined
materialsTable.columns.adjust().draw();

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.