I would like to combine 2 tables but somehow keep the paying members at the top of the table while allowing customers to filter both tables or groups of data together. Is this possible, or is there some other way to keep one cohort of data always at the top of the table, even when filtering? Thank you, Margaret
Please disregard the other details for now about combining 2 tables (I will get back with you on that).
As far as filtering... I want to keep my "Paid Subscribers" at the top of the table, even when filtering. Is there a way to hide/lock my "Paid Subscriber" filter so that users can't adjust that part of the table? It would be similar to my screenshot. I haven't figured this out in wpdatatables yet otherwise I would send you a screenshot of that.
Sorry for the delay, i took some time to confirm if this is possible.
I am still not 100% sure if we understood what you need exactly for this use-case.
-
If I understand, you don't need filtering, but sorting, in order to keep some values on top of others.
If you need some rows in the table to be on top of others, we can only achieve that by sorting on a particular column.
For example, if you have a column of "Subscribers", you can set this to be the default "sort by this column" in that column settings.
Here is an example with my dummy table. If I want to sort table by this column "Position".
By default, it is sorting by ID column.
But I will set it to sort the table by Position on table load.
If we need to remove/disable sorting on other columns, you can do that in column sorting settings.
I have disabled sorting for lastname, birthdate and date hired columns, for example, so now users on front-end will not be able to change sorting on those columns.
But they will be able to click into the header of "Position" to change the sorting of this column.
2. The only way you can force specific sorting for the table, there is a custom workaround, with an SQL Query based table;
we are not suggesting to use ORDER BY at all in queries,
because wpDataTables plugin is adding it dynamically based on what is set to be the default sorting column.
But if you disable the Sorting option for wpDataTable and create wpDataTable from SQL query e.g:
SELECT * FROM `my_table` ORDER BY ColumnB ASC
It will create and show wpDataTable with pre-loaded sorting, but nobody will not be able to use any Sorting anymore for this table.
-
Or, if you need to sort by multiple columns, like "Sort by this column first, then by another column",
SELECT * FROM `my_table` ORDER BY ColumnB ASC, ColumnC ASC
( You can change the order from Ascending (ASC) to descending ( DESC)
-
That is it when it comes to sorting tables, for the time being we don't have any other options available.
If I did not understand you correctly, and you want to sort the way how filtering options are available, for example for a selectbox, multiselectbox and checkbox filters,
you can manually order the way how filtering values appear,
in the Column settings/Data tab,
you can set predefined values and the order in which you define them will be the order how they line up on the Column filter.
For example, if in my column Position I want to set up filter above the table, and to set first one to choose as 'Office Manager' , then 'Developer' , then 'Secretary' :
And then, the order in which I placed them here, is the order they will load for the filtering options of that column.
Let me know if that helps, or if you need something different?
I made a mistake and meant to say "sort" not "filter." This was a very helpful explanation and It looks like it'll work for what I need to do. Thank you for taking the time to help me!
Hello,
I would like to combine 2 tables but somehow keep the paying members at the top of the table while allowing customers to filter both tables or groups of data together. Is this possible, or is there some other way to keep one cohort of data always at the top of the table, even when filtering?
Thank you,
Margaret
Hi, Margaret.
I am sorry, but i did not understand the use-case you described.
I realise that you wish to keep certain data at the top of the table regardless of filtering,
but i did not fully understand the other details.
Is it possible to show us some screenshots or also add a Video to show us your use-case,
what kind of data it will be, and what is the goal?
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
Hi Miloš,
Please disregard the other details for now about combining 2 tables (I will get back with you on that).
As far as filtering... I want to keep my "Paid Subscribers" at the top of the table, even when filtering. Is there a way to hide/lock my "Paid Subscriber" filter so that users can't adjust that part of the table? It would be similar to my screenshot. I haven't figured this out in wpdatatables yet otherwise I would send you a screenshot of that.
Kind regards,
Margaret
Attached files: Filter excel example.jpg
Hi, Margaret.
Sorry for the delay, i took some time to confirm if this is possible.
I am still not 100% sure if we understood what you need exactly for this use-case.
-
If I understand, you don't need filtering, but sorting, in order to keep some values on top of others.
If you need some rows in the table to be on top of others, we can only achieve that by sorting on a particular column.
For example, if you have a column of "Subscribers", you can set this to be the default "sort by this column" in that column settings.
Here is an example with my dummy table. If I want to sort table by this column "Position".
By default, it is sorting by ID column.
But I will set it to sort the table by Position on table load.
If we need to remove/disable sorting on other columns, you can do that in column sorting settings.
I have disabled sorting for lastname, birthdate and date hired columns, for example, so now users on front-end will not be able to change sorting on those columns.
But they will be able to click into the header of "Position" to change the sorting of this column.
- You can see more details about our built-in sorting logic here https://wpdatatables.com/documentation/table-features/sorting/.
2. The only way you can force specific sorting for the table, there is a custom workaround, with an SQL Query based table;
we are not suggesting to use ORDER BY at all in queries,
because wpDataTables plugin is adding it dynamically based on what is set to be the default sorting column.
But if you disable the Sorting option for wpDataTable and create wpDataTable from SQL query e.g:
It will create and show wpDataTable with pre-loaded sorting, but nobody will not be able to use any Sorting anymore for this table.
-
Or, if you need to sort by multiple columns, like "Sort by this column first, then by another column",
( You can change the order from Ascending (ASC) to descending ( DESC)
-
That is it when it comes to sorting tables, for the time being we don't have any other options available.
If I did not understand you correctly, and you want to sort the way how filtering options are available, for example for a selectbox, multiselectbox and checkbox filters,
you can manually order the way how filtering values appear,
in the Column settings/Data tab,
you can set predefined values and the order in which you define them will be the order how they line up on the Column filter.
For example, if in my column Position I want to set up filter above the table, and to set first one to choose as 'Office Manager' , then 'Developer' , then 'Secretary' :
And then, the order in which I placed them here, is the order they will load for the filtering options of that column.
Let me know if that helps, or if you need something different?
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
Hi Miloš,
I made a mistake and meant to say "sort" not "filter." This was a very helpful explanation and It looks like it'll work for what I need to do. Thank you for taking the time to help me!
Margaret
Hi, Margaret.
Sorry for the waiting time.
We don't work on weekends so it adds two days to the waiting time.
we appreciate your patience.
-
I am glad that the informations were useful, and i hope that you can achieve your use-case as intended for the sorting.
Let us know how it goes and if you have any further questions about this.
If you have any other/unrelated questions, please don't hesitate to open new tickets.
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