It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Multi Checkboxes design

How to modify the custom field Multi Checkboxes to be displayed in horizontal ?


4 answers

1 accepted

2 votes
Answer accepted

<script language="javascript">
var YOUR_CF_NAME = "check boxes";

AJS.$(document).ready(function(){
for(var i=0; i < AJS.$("fieldset").length; i++) {
if(AJS.$("fieldset:eq(" + i + ") legend span")[0] != null && AJS.$("fieldset:eq(" + i + ") legend span")[0].innerHTML == YOUR_CF_NAME) {
AJS.$("fieldset:eq(" + i + ") div").css('display', 'inline');
AJS.$("fieldset:eq(" + i + ") div").css('float', 'left');
}
}
});
</script>
  • Change the YOUR_CF_NAME value up there to the name of your customfield, as the script is not aware of the name of your custom field, so you need to tell it.
  • You may place it in Administration > Issue Fields > Field Configurations > <your-field-configuration> > Edit (for your check box cutomfield)

thanks for the support

Hi, sorry for the bump but here's the update one based on my knowledge and skills and using your code as reference.. I've made changes although it is not the best

var YOUR_CF_NAME = "customfield_<customfieldid>";

for(var i=0; i < $("fieldset").length; i++) {
if(i > 0 ) {
$("fieldset:eq(" + i + ") div").css('display', 'inline');
$("fieldset:eq(" + i + ") div").css('float', 'left');
$("fieldset:eq(" + i + ") div").css('margin-left', '10px');

})
0 votes

You'll need to amend the view-multiselect.vm file and restart Jira.

#if ($value)

<div class="shorten" id="${customField.id}-field">

#foreach ($singleValue in $value)
<span>$!singleValue.toString()#if ($velocityCount != $value.size())</span>,#end
#end
</div>
#end

what should i modify in order to be displayed horizontal

Changing the div to a span might do it, though I haven't tried - since a div starts a new line and a span doesn't.

I mean Multi Checkboxes

NO CHANGE also i delete work folder and restarted the service but the combobox sill in vertical

#if ($value)

<span>
#foreach ($singleValue in $value)
<span>$!singleValue.toString()#if ($velocityCount != $value.size())</span>,#end
#end
</span>
#end

I mean Multi Checkboxes
Choose multiple values using checkboxes.

I am new to Jira, but I am confused. I am using Jira 4.4.3 and the information about where to put these changes does not make any sense to me. When I look at the html source file through the browser, the css comes from a file named batch.css. The veiw-multiselect.vm does not seem to match source html structure. There is no class shorten in the source html and the id does not match either.

The directions claims we can add javscript through the adminstration interface, but there nothing I can find in the field configuration area where I can add javascript.

I did find the aui-overrides.css file, but I cannot find any information about how that file information gets into batch.css.

What is the real scoop here?

Suggest an answer

Log in or Sign up to answer
TAGS

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