Skip to main content
Nintex Community Menu Bar

Repeating section duplicate row

  • Jun 6, 2017 10:17 AM UTC
  • 29 replies
  • 92 views
  • Translate All

Forum|alt.badge.img+3

Hello all to my friends,

I'm looking for solution/tips/tricks for my task.

I need to do:

1) Add repeating section to form - check!

2) Add text-box in repeating section form - check!

3) Input value - check;

4) Create button, which duplicate text-box and create a new line with text-box with input value. ( shortly - duplicate previously text-box) - not check..

I tried example ->   - but this is not what I want :/ 

All minds/opinions/suggestion are welcome!

29 replies

Forum|alt.badge.img+14
  • Scholar
  • Jun 6, 2017 2:41 PM UTC

does it have to be separate button? couldn't you use OOTB provided 'Add new row' link?

when new repeater row is being added there are generated Before-/After-RepeaterRowAdded events for which you could write your own handler and copy value from previous row.

see  

Translate

Forum|alt.badge.img+3
  • Author
  • Jun 6, 2017 6:25 PM UTC

I would try this option with events!

For another button, I don't know, maybe its  not necessary to add a new button. 

Translate

Forum|alt.badge.img
  • Aug 28, 2017 8:36 PM UTC

Can some give an example?  I see the JavaScript  events before/ after filler.  What info would go into it to trigger the copy or duplication?

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 30, 2017 7:08 PM UTC

do you mean example of how to use RegisterRepeaterRowAdded event?

see https://community.nintex.com/message/45769-re-custom-validation-function-not-fired-on-repeating-section?commentID=45769#… 

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 30, 2017 7:09 PM UTC

Hi Mantas Šedys‌, were you able to resolve this?

Translate

Forum|alt.badge.img
  • Aug 30, 2017 8:35 PM UTC

I want to copy information from one field to another in repeating section row.  What would the function be in nintex?

I am trying to use this to get the output.

function copy_data(val){ var a = document.getElementById(val.id).value  document.getElementById("copy_to").value=a}

207140_pastedImage_1.png

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 31, 2017 10:16 PM UTC

then you might want to look on these threads

Can you duplicate a repeating section in the same form? 

 

both of them show a way how to copy value among controls in repeating section(s)

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 11, 2017 5:21 AM UTC

Hi Marian,

this project was side-job, so it's still necessary and i'm planning to do it in November! 
Still on focus! happy.png

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 11:29 AM UTC

Marian Hatala‌, Alexander Hunt‌

I'm in progress with this task.

Now I'm using Nintex Forms - Numbering a Repeating Section - Vadim Tabakman  Vadim example, just add some functionality by my needs.

I copy the first textbox in repeatingSection and add it's value to the new textbox:

In text box "Client ID JavaScript variable name" is set pirm.

Code:
var x = document.getElementByID(pirm).value;

and after if()

NWF$(repeaterRow).find('.empty').find('input').val(x);

Maybe You have ideas, how to detect last row and get textbox value from it?
Maybe with Row number?
Looking forward to hear news from You all happy.png 

adding full code:

Repeating Code · GitHub 

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 1:02 PM UTC

‌,

You are good in repeating section explanation. Could You help us? happy.png 

Translate

Forum|alt.badge.img+14
  • Scholar
  • Oct 25, 2017 1:39 PM UTC

you can read textbox control's value from last repeater row as follows.

note to use class selector instead of javascript variable.

NWF$('.vtMyRepeatingSection .nf-repeater-row:not(.nf-repeater-row-hidden):last .primClass input').val()‍

reg. numbering repeater rows, note Vadim's blog is from 2015.

you need not to calculate rownumber on your own anymore, there already exist  currentRowNumber() runtime function.

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 2:14 PM UTC

I would try this option!

I'm stuck in SP2010, so using old methods confused.png

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 2:36 PM UTC

getting a message (with alert() ) - undinefined..

Code snippet: RepeatingRow · GitHub 

Translate

Forum|alt.badge.img+14
  • Scholar
  • Oct 25, 2017 2:39 PM UTC

do you refer to currentRowNumber() function?

by the documentation it should be available in Forms2010 as well - https://help.nintex.com/en-US/nintex2010/help/#Forms/RootCategory/Designer/Nintex.Forms.RuntimeFunctions.htm%3FTocPath%3… 

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 3:01 PM UTC

Found this function!
definitely I will try it!

Translate

Forum|alt.badge.img+14
  • Scholar
  • Oct 25, 2017 3:11 PM UTC

try to remove selectors one by one from the end to determine where it starts failing.

like

NWF$('.vtMyRepeatingSection .nf-repeater-row:not(.nf-repeater-row-hidden):last .primClass input').length

NWF$('.vtMyRepeatingSection .nf-repeater-row:not(.nf-repeater-row-hidden):last .primClass').length

NWF$('.vtMyRepeatingSection .nf-repeater-row:not(.nf-repeater-row-hidden):last').length

...

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 3:35 PM UTC

You're pro, Marian Hatala‌ happy.png

Tested and only with the last one 

NWF$('.vtMyRepeatingSection .nf-repeater-row:not(.nf-repeater-row-hidden):last').length

get result = 1; 

But it should return much more. 

Translate

Forum|alt.badge.img+14
  • Scholar
  • Oct 25, 2017 3:43 PM UTC

but you have just one single last row, haven't you? happy.png

that means it can not find any any control with "primClass" "CSS class".

a typo?

can you post configuration of 'prim' text control?

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 3:54 PM UTC

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 25, 2017 4:11 PM UTC

Now trying with line : 

alert(NWF$('.RP .nf-repeater-row:not(.nf-repeater-row-hidden):last .prim input').length);

get asnwer = 2

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 26, 2017 7:20 AM UTC

Optimize my code, so its much more smaller, but still get answer 1.. 

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 26, 2017 7:22 AM UTC

get answer = 2*

Translate

Forum|alt.badge.img+14
  • Scholar
  • Oct 26, 2017 8:11 AM UTC

Answer 2 is correct.

Replace length with val() and you should get the value

Translate

Forum|alt.badge.img+3
  • Author
  • Oct 26, 2017 8:30 AM UTC

Get empty value..

Translate

Forum|alt.badge.img+9
  • Nintex Partner
  • Oct 26, 2017 8:44 AM UTC

Can you try with the following line :

NWF$('.RP .nf-repeater-row:not(.nf-repeater-row-hidden):last input.prim').val()

Translate