Is it possible to have either a drop-down list or some way to set in the shortcode which columns should be visible? I'd like different "views" that are easy to switch between for a table that has a lot of columns.
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
Sorry to disappoint you on this, but at the moment, there is no way to achieve dynamic column visibility as you described via Table Shortcode.
At the moment, you can only allow front-end users the capability to hide or show columns through a checkbox via the Table Tools "Column visibility" button.
If this button is turned on for the table, your front-end table users will be able to toggle the visibility of the table’s columns.
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
Right now, for the use-case where you need to have different 'views' such as the same data shown with only Column A, B and C for example on Page 1, while Page 2 should show more columns;
The only workaround is to make multiple SQL Query based tables which call the same source data from your database.
For example, you can have one main/master Manual table which will store all the data in the database.
Then, you can check this table's MySQL Table name from the Editing tab in the back-end table settings,
and you will be able to make multiple SQL tables that pulls data from the same "master table",
and any editing you do on all these other SQL tables are going to be stored in the same table in the database,
This will be my example table :
Now, to make a new SQL Table from it,
first, check in Editing Tab/MySQL table name for editing:
in my example, the Manual table name is wp_wpdatatable_39,
so i make a new SQL table that will pull data from it;
and we can choose all columns like :
SELECT * FROM Table_Name
or just specific columns;
we can also have completely different settings/filtering/sorting and limitations for front-end users on each table;
and you can make multiple SQL Query tables that pull the same data from the "main table".
SELECT column_name1,
column_name2,
column_name3
FROM table_name
-
In this example, if i want to limit to only show the "Company" column, and i will leave wdt_ID ( because we got to have row ID) and userid ( if we want userID for limiting rows per currently logged user ID),
when i hide those columns in the end, the front-end user will only see the "company" column.
SELECT wdt_ID,
userid,
company
FROM wp_wpdatatable_39
Later, you can make another SQL Table that will show some other columns, have other filters and so on ( depending on what you need to achieve)...
-
And i just wanted to point out that you can try wpDataTables before purchasing on our sandbox Demo sites ( you can find links for the main plugin Demo, as well as add-on Demos, in my signature);
and there is a 15-day money-back guarantee period,
so if you purchase the plugin, you can safely fully test it out, and if it doesn't fit your needs you can request and receive a refund in that period. ( same goes for all plugins and add-ons)
Hi
Is it possible to have either a drop-down list or some way to set in the shortcode which columns should be visible? I'd like different "views" that are easy to switch between for a table that has a lot of columns.
Any ideas?
Thanks!
Hi David,
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
Sorry to disappoint you on this, but at the moment, there is no way to achieve dynamic column visibility as you described via Table Shortcode.
At the moment, you can only allow front-end users the capability to hide or show columns through a checkbox via the Table Tools "Column visibility" button.
If this button is turned on for the table, your front-end table users will be able to toggle the visibility of the table’s columns.
Please note that it also includes the columns that you’ve hidden from the back-end.
You can un-select the button to hide the column and select it back to show it.
So at the moment, we don't have a way to dynamically show/ or hide columns through the shortcode.
You can make a future development suggestion, but we can't say an ETA.
Please feel free to search on our suggestions page,
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
Right now, for the use-case where you need to have different 'views' such as the same data shown with only Column A, B and C for example on Page 1, while Page 2 should show more columns;
The only workaround is to make multiple SQL Query based tables which call the same source data from your database.
For example, you can have one main/master Manual table which will store all the data in the database.
Then, you can check this table's MySQL Table name from the Editing tab in the back-end table settings,
and you will be able to make multiple SQL tables that pulls data from the same "master table",
and any editing you do on all these other SQL tables are going to be stored in the same table in the database,
This will be my example table :
Now, to make a new SQL Table from it,
first, check in Editing Tab/MySQL table name for editing:
in my example, the Manual table name is wp_wpdatatable_39,
so i make a new SQL table that will pull data from it;
and we can choose all columns like :
or just specific columns;
we can also have completely different settings/filtering/sorting and limitations for front-end users on each table;
and you can make multiple SQL Query tables that pull the same data from the "main table".
-
In this example, if i want to limit to only show the "Company" column, and i will leave wdt_ID ( because we got to have row ID) and userid ( if we want userID for limiting rows per currently logged user ID),
when i hide those columns in the end, the front-end user will only see the "company" column.
Later, you can make another SQL Table that will show some other columns, have other filters and so on ( depending on what you need to achieve)...
-
And i just wanted to point out that you can try wpDataTables before purchasing on our sandbox Demo sites ( you can find links for the main plugin Demo, as well as add-on Demos, in my signature);
and there is a 15-day money-back guarantee period,
so if you purchase the plugin, you can safely fully test it out, and if it doesn't fit your needs you can request and receive a refund in that period. ( same goes for all plugins and add-ons)
Let me know if you have any additional questions.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thank you so much. The SQL workaround is working.
Hi David,
I am delighted to hear that this SQL workaround is working well for your use-case.
Anything else that we could assist with, please don't hesitate to create new tickets.
We will go over the attachment issue on the new ticket as soon as possible.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables