Filter form control confiform after and before execution

dunick voltaire May 26, 2022

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

0 votes
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2022

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

dunick voltaire May 26, 2022

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>

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2022

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

dunick voltaire May 26, 2022

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.

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2022

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 

dunick voltaire May 26, 2022

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.

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2022

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
AUG Leaders

Atlassian Community Events