Adding component to the template
Adding component to the template
Hello, i am trying to implement a simple way to dynamically show/hide columns.
What i'm doing so far:
the server outputs all the data i need to the standard html table.
datatables initializes and only shows the default columns i picked.
a select/options dropdown containing names of each column and the corresponding value of the column.
a show/hide that calls fnSetColumnVisible on the selected option.
Problem: ideally I would like to be able to put this dropdown and the show/hide button in the sDom template mabey with it's own letter ("S" for example) (jQueryUI is enabled), so am wondering how to achieve this. Or if it's not easy, just to put the dropdown to the right of the "Show XX entries" dropdown.
EDIT: i will also be trying to save the selected columns in a cookie and if there is any interest in this i could try to release it as a plugin
-Will
What i'm doing so far:
the server outputs all the data i need to the standard html table.
datatables initializes and only shows the default columns i picked.
a select/options dropdown containing names of each column and the corresponding value of the column.
a show/hide that calls fnSetColumnVisible on the selected option.
Problem: ideally I would like to be able to put this dropdown and the show/hide button in the sDom template mabey with it's own letter ("S" for example) (jQueryUI is enabled), so am wondering how to achieve this. Or if it's not easy, just to put the dropdown to the right of the "Show XX entries" dropdown.
EDIT: i will also be trying to save the selected columns in a cookie and if there is any interest in this i could try to release it as a plugin
-Will
This discussion has been closed.
Replies
It's certainly possible to add a component which would do something exactly like this. Have a look at the feature development page: http://datatables.net/development/features
Also you might be interested in looking at the TableTools code (specifically the very bottom bit) which uses this method: http://datatables.net/release-datatables/extras/TableTools/media/js/TableTools.js
I'm afraid that there is not plug-in which currently exists which does what you are looking for, but if you do create one, please do post back, as I'm sure others would be most interested!
Regards,
Allan