Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,620
Community Members
 
Community Events
165
Community Groups

Filter form control confiform after and before execution

But how does the filter form control use JavaScript before and after execution?  

What I'm trying to do is before the filter happens to the table there is a JavaScript code that hides the table, which is executed by the filter control before and after the filtering, it will show the table using the after. Can the filter control do that?

1 answer

1 accepted

Hi

At the moment you can set up the filter macro to execute custom JS when it loads (page render) and right after the filter is applied -> meaning when the filter result is received from the backend and is updated on the page view

Alex

This is the simple script I want to run I want to hide before and after the filter runs to show the table. Am I going about it the wrong way? Or is it not possible?

<script>
function showtable1(){
AJS.$('table1').show();
}

function hidetable1(){
AJS.$('table1').hide();
}
</script>

I am a bit sceptical about your "scripts", but may I ask you - why do you want to hide the "table"?

To hide it initially there is a better way - just set the "filter to apply on dataset" to be something like

created:<0

Alex

Thank you, this works and I know that my small piece of 'code' is not a 'script' lol my bad. I understand why created:<0 works but how?
I was trying to hide data based on the user so that everyone does not see each other input. Thank you again and I'm still new to using JavaScript.

To make form’s data secure disable edit permissions on the page where the form definition (macro) is and set the form’s parameter to allow seeing only own data for forms non admin users (on form definition macro)

Alex 

Oh, I understand but the organization i work for switching supervisor frequently so it would be annoying to update that information every time. The table I was trying to hide was the one supervisor see so that they don't see each other departments employee's input and the solution you gave work and so now I can send them the person name they input into the filter and only see that person input and thank you again.

Probably you need to use security groups instead. 
But glad things worked out for you 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

792 views 6 21
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you