Hello
I'm trying to hide a <hr/> rule inside a table filter when the table filter returns no values.
Is there any way to achieve this?
Hi @sa_mejia ,
I can suggest wrapping your Table Filter macro into the Table Transformer macro:
So when you don't have any suitable rows to display, you'll get a blue info message that there are no any rows returned (not the empty table header row as you had before).
Hi.
Thanks for your reply,
I was thinking in something that allows me to hide some elements that are inside of this filter like the hr (horizontal rule) when there's a filter applied and there are no matches, probably via CSS.
something like .tablefilter:empty(){ hr class-name {display : none;}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We often use CSS to hide specific items from the Table Filter menu. Here is an example of several expressions to hide the "Hide columns" option for the different variants of the macro usage.
What exactly do you need to do? Do you use a filtering panel and when there are no any results you want to hide it? So your colleagues won't see it and won't know about the applied filters?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Katerina Kovriga _Stiltsoft_
I hope you're still listening to this posting... ;-)
I was looking for a solution to avoid the display of the empty table header row if the filter conditions are set too restrictive. I found your solution, to wrap the Table Filter macro with a Table Transformer macro and it's a great solution. BUT:
Now the table filters are no longer displayed above the table, but below it.
This is also visible in your example (see screenshot). Since my table is rather long, this is not an acceptable solution. How can this be avoided?
Regards
Ulrik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems that is all we can suggest. Originally, the table header is supposed to be always visible.
Maybe in you case it's better to switch to the filters in headers instead of the filtration panel: you'll get just a header with compact filter icons if there are no any suitable rows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for your quick reply. I already had this idea. Unfortunately, it does not work:
The filters in the header rows are not displayed if the Table Filter Macro is wrapped by a Table Transformer Macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Firstly, why do you need the Table Transformer macro if you switched to the filters in headers?
Secondly, for me the filters in the headers work as they are supposed inside the Table Transformer macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'll try to clarify what I mean. BTW: We are using your Table Filter app V12.0.3 and Confluence 8.5.18 DC.
This is my use case:
If the user selects filters from the filtration panel that do not give any results, the normal behaviour of the Table Filter macro is that only the table header row is displayed.
To my experience this irritates users. I'd prefer a displayed message. Unfortunately it is currently not possible to configure this in the Table Filter macro.
An additional option like in the screenshot below would be a solution:
WORKAROUND
According to Katerina a wrapping Table Transformer macro creates such a message if the table is empty. This workaround is OK but unfortunately the filtration panel is no longer displayed on top of the table but at the bottom. Which makes the workaround unusable for us.
I just wanted to know if there is a trick for the workaround to show the filtration panel above the table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As we've mentioned before, the workaround with the Table Transformer macro is just a workaround, so it works as it works.
The table headers are not supposed to be hidden initially. So, if your users don't want to see both the filtration panel and the table header, you may switch to the filters in the headers and your users will see only the table header with tiny filter icons.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My users and I have no problem at all with the Filtration panel. On the contrary, the panel is often used to filter the table. Therefore, it should of course be visible.
However, entering filter conditions is very cumbersome if the filtration panel is below the table and not above of it. At least if the table is very long. And imho, a filter option is usually expected above a table.
I have understood that the workaround with the Table Transformer Macro - which is only used to display a hint instead of an empty table if the filter conditions are too restrictive - obviously does not offer this possibility.
Thanks very much for this explanation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe we weren't clear about the workaround:
Here is a screenshot taken when we choose to Show all content in the Table Transformer macro.
The header is your original table when the filters are too strict and there are no any rows. It comes from the Table Filter macro.
The filtration panel comes with the original table and also belongs to the Table Filter macro.
The blue message is an output of the Table Transformer macro. And the output of the external macro is always on top.
If the filters are not strict, we will have the same view but with the whole table:
By choosing the Hide tables option in the Table Transformer macro we hide the original table coming from the Table Filter macro (and it is the second lower table!).
So, on top we have the table coming from the Table Transformer macro. Below it we still have the filtration panel from the Table Filter macro.
The filtration panel remains until we choose the Hide all content option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the detailed explanation of how it works. I hadn't actually thought about the Source data option. This was set to "Hide tables" (apparently the default value).
So the table that is displayed with this setting is the output of the Table Transformer macro. This was not clear to me and of course explains why the filtration panel is displayed below the table. And also why filters in header were not displayed in my case.
Unfortunately, this doesn't help me for my use case. But now I can at least understand what is happening. Thanks again for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ulrik Schoth ,
The following structure may help to keep the filtration panel above the table:
It seems to be rather overloaded though, so we've created a feature request for our internal roadmap - this ticket is linked to it, so we'll come back here with the updates when it's implemented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks for the new workaround. This produces exactly the display I had in mind. But to be honest, I would prefer a simpler solution and would therefore be happy to have a corresponding option directly in the Table Filter macro.
FYI, in case you haven't already noticed: I had started a feature request on this topic after my last reply (TFCS-6190).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.