Add API for retrieving non-visible columns
Closed this issue · 1 comments
Hello, could you add a JS function for retrieving the non-visible column names?
Right now this could be done with JSON.parse(localStorage.getItem("django_tables2_column_shifter"))
however I think it would be better if there was a global function (or maybe a method of $
like $.get_non_visibe_columns
).
This would be very useful in case somebody wants to export only the visible columns when exporting the data, thus when the user clicks on the export button it would append an &excluded_columns=col1,col2
to the button's href which would then be used by the TableExporter
: http://django-tables2.readthedocs.io/en/latest/pages/export.html#excluding-columns to exclude these cols, i.e something like
exporter = TableExport('csv', table, exclude_columns=self.request.GET.get('excluded_columns').split(',))