A co-worker has created a custom field for a form, it only contains a whole bunch of checkboxes. (they simply created the field. Added the options. That's it)
Now by default it seems that you can give some styling with jQuery by giving each <div> element a style. But that means you can either sort the checkboxes and show them all in one line or display them like a list.
However they want to display these checkboxes as:
x x
x x
x x
x x
Any ideas on how to realise this? It seems difficult as somehow Jira creates these checkboxes all inside their own div element.
Thank you in advance.
You can add JavaScript to the description of the custom field. I believe you want something like this:
<script language="javascript">
AJS.$(document).ready(function(){
Array.from(document.body.getElementsByClassName("checkbox")).forEach(function (cbox) {
if (cbox.getAttribute('name')=='customfield_17126') {
cbox.parentNode.style.cssFloat='right';
cbox.parentNode.style.width='33%';
}
});
});
</script>
Just make sure to replace the number of the custom field ID to whatever your's is.
Hi @Jeffrey de Boer !
Have you managed to complete this task?
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.