Column Count
Column Count
Hi there,
Is there a way to return the number of columns from the initial table? I'm using fnSetColumnVis and the JavaScript I am using to count the columns is reporting less after I hide some of the columns.
I'm a newbie, so please be gentle. :-)
Graham.
Is there a way to return the number of columns from the initial table? I'm using fnSetColumnVis and the JavaScript I am using to count the columns is reporting less after I hide some of the columns.
I'm a newbie, so please be gentle. :-)
Graham.
This discussion has been closed.
Replies
table.fnSettings().aoColumns.length
[/code]
will get you the number of columns ( http://datatables.net/docs/DataTables/1.9.1/DataTable.models.oSettings.html#aoColumns ).
It could be wrapped up into an API method to make it a bit easier: http://datatables.net/blog/Creating_feature_plug-ins
Allan