Question: How can I exclude the last column of jQuery DataTables.net when using the TableTools extras to export?
Details
I\
You can exclude using class names like this:
"aoColumnDefs": [{ "mColumns": false, "aTargets": ["no-export"] }],
Here is similar code I have working in production:
var oTable = $('#<%= gvComputers.ClientID %>').dataTable({
"bJQueryUI": true,
"bStateSave": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [[5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"]],
"aoColumnDefs": [
{ "sSortDataType": "dom-text", "aTargets": ["text-sort_fixed"] },
{ "sType": "numeric", "aTargets": ["numeric-sort"] },
{ "sSortDataType": "dom-select", "aTargets": ["select-sort"] },
{ "sSortDataType": "dom-checkbox", "aTargets": ["checkbox-sort"] },
{ "bSearchable": false, "aTargets": ["no-search"] },
{ "bSortable": false, "aTargets": ["no-sort"] }
]
});
I set the classes as needed on my table header, footer and cells dynamically since I do not know what columns the user will remove from their personal view of the data.
hth