Hi,
How can I put one argument on "aoColumns" for the first column from my table? Example:
"aoColumns": [
{ "bVisible": false },
],
I have a dinamic table and when a put like this, give a error.
for (i = 1; i < cols; i = i + 1) {
arr.push(null);
}
$('#results').dataTable({
"aoColumns": arr
});
In the above example I grab the number of TH's my table has (i.e. columns) and build an array that I will set to my aoColumns parameter. Additionally in the example, I know that I always have at least 1 column and that the first column is not sortable.
Replies
var cols = $('th').size();
var i = 0;
var arr = [
{ "bSortable": false },
];
for (i = 1; i < cols; i = i + 1) {
arr.push(null);
}
$('#results').dataTable({
"aoColumns": arr
});
In the above example I grab the number of TH's my table has (i.e. columns) and build an array that I will set to my aoColumns parameter. Additionally in the example, I know that I always have at least 1 column and that the first column is not sortable.
Thank you very much.