Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Hide Components field using jQuery during Resolve transition

Hanumesh Jojode September 26, 2011

I have developed a custom field and this custom field pops up during "Resolve" transition. The requirement is that based on this custom field value selection, i need to hide/show componenet/s field on the same transition screen.

What i have been thinking is that, I will add Component/s field as required fields during "Resolve" transition so that component/s are displayed and allowed to edit during "Resolve" transition. All I have to do is to write a jQuery piece of code in my "<customfield>-edit.vm" that can hide/show the componenets field. So how to tweak jQuery code to access component/s Div or panel to hide/show is the point where am struck right now. Any thoughts would be very helpful.

Soon as "Resolve" screen loads, component/s field show be hidden. How to do this using jQuery?

And if i get to know how to hide, I can easily write for show() based on the custom field value that users select.

Cheers,

Jo

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Hanumesh Jojode October 11, 2011
jQuery(document).ready(function(){
var row = document.getElementById("componentsFieldArea");
row.style.display = 'none';
}
0 votes
JamieA
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.
September 26, 2011

I can give you the relevant selectors to do this, although it is a bit of a pain for popup dialogs. However I think you should avoid reinventing the wheel by using the behaviours plugin. For your requirements you would create a new behaviour, add the custom field, click "Add serverside script", then type in:

FormField selectList = getFieldById(getFieldChanged())
        FormField comps = getFieldById("components")
        boolean showComps = selectList.getValue() == "THE SPECIAL VALUE"
        comps.setHidden(showComps)

Then apply the behaviour to your project, and it should all work (but this script untested).

Hanumesh Jojode September 27, 2011

Thanks Jamie for your reply. But how to achieve this through a scripting language?

i tried document.getElementBy("#component").hide() and jQuery("#component").hide()

but no luck!

JamieA
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.
September 27, 2011
AJS.$("#components").parent().hide()

Hanumesh Jojode September 28, 2011

Thanks Jamie, but AJS too was not able to hide the filed. So i am trying out your plugin now..

TAGS
AUG Leaders

Atlassian Community Events