cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Workflow Hero

Formatting repeating section of the form

Jump to solution

i have a nintex form with repeating section. This section has some text fields and a choice field. I would like to change the color of the row based on the value selected in choice field. for example if choice is A then that row will be red color, if choice is G that row will be green color. How do i do that. i selected the repeater section -> add rule... how do i select choice column and check?

Tags (1)
0 Kudos
Reply
10 Replies
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

unfortunately it's not possible to apply rules on single repeating section's rows.

you will have to turn to  javascript to make it happen.

eg. following code that register onchange handler to respective choice control could do the trick

    NWF$('.ColorSelectorClass').change(function(evt){
           NWF$(evt.target).closest('.nf-repeater-row')[0].style.backgroundColor=evt.target.value;
     })
‍‍‍

I used color names directly as choice values

attached find small example form.

Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

Thanks it worked for me, though i was not doing it through onchange event, but did it through onload of the form.

Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

fine if that's enough for you.

note however, that colors will not change with choice change and as well this approach need not work for controls that are populated asynchronously (eg. lookups)

Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

i have one more question, based on the color of the repeater control i wanted to disable or hide the delete icon (delete row) in the control. How do i do that? i dont want it in onchange event but on page load event...

Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

quite similar way like you set colors.

I wouldn't write special condition that would disable the icon by color but rather set icon state along with the color.

the script to disable icon will look like:

NWF$(NWF$('.attachmentControlClass').find('.nf-attachmentsRow .nf-orphaned-attachment')[2]).find('.propertysheet a').prop('disabled','disabled')

[2] means 3rd attachment

I assumed EDIT form.

0 Kudos
Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

i mean delete button in repeater control. How do i get it

Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

ups! sorry.

I somehow switched to wrong context

try this

NWF$(NWF$('.repeaterControlClass.nf-repeater .nf-repeater-row')[2]).find('img.nf-repeater-deleterow-image').hide();

[2] now means 2nd repeater row

Reply
Not applicable

Re: Formatting repeating section of the form

Jump to solution

Hi, ‌, are you able to mark one of ‌'s answers correct by clicking the "mark correct" button in a reply? It's helpful to other community members who search for similar questions. Thanks!

0 Kudos
Reply
Workflow Hero

Re: Formatting repeating section of the form

Jump to solution

Marian, I am looking to hide all delete icons from all repeating section rows on my form, by default. Looks like your code might do the trick, except I'm not sure how to combine the snippets. Can you guide me on this and where to place the code (I assumed Form settings/Custom JavaScript)

0 Kudos
Reply