columns is undefined
columns is undefined
Mindaugas
Posts: 1Questions: 1Answers: 0
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
This discussion has been closed.
Answers
You aren't using the new API. See the second FAQ: http://datatables.net/faqs/#api :-)
Allan