Skip to main content
Nintex Community Menu Bar

Repeating section duplicate row

  • June 6, 2017
  • 29 replies
  • 59 views

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
  • June 6, 2017

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  


Forum|alt.badge.img+3
  • Author
  • June 6, 2017

I would try this option with events!

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


Forum|alt.badge.img
  • August 28, 2017

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?


Forum|alt.badge.img+14
  • Scholar
  • August 30, 2017

Forum|alt.badge.img+14
  • Scholar
  • August 30, 2017

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


Forum|alt.badge.img
  • August 30, 2017

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


Forum|alt.badge.img+14
  • Scholar
  • August 31, 2017

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)


Forum|alt.badge.img+3
  • Author
  • October 11, 2017

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


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

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 


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

‌,

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


Forum|alt.badge.img+14
  • Scholar
  • October 25, 2017

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.


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

I would try this option!

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


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

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

Code snippet: RepeatingRow · GitHub 


Forum|alt.badge.img+14
  • Scholar
  • October 25, 2017

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… 


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

Found this function!
definitely I will try it!


Forum|alt.badge.img+14
  • Scholar
  • October 25, 2017

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

...


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

You're pro, Marian Hatalahappy.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. 


Forum|alt.badge.img+14
  • Scholar
  • October 25, 2017

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?


Forum|alt.badge.img+3
  • Author
  • October 25, 2017


Forum|alt.badge.img+3
  • Author
  • October 25, 2017

Now trying with line : 

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

get asnwer = 2


Forum|alt.badge.img+3
  • Author
  • October 26, 2017

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


Forum|alt.badge.img+3
  • Author
  • October 26, 2017

get answer = 2*


Forum|alt.badge.img+14
  • Scholar
  • October 26, 2017

Answer 2 is correct.

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


Forum|alt.badge.img+3
  • Author
  • October 26, 2017

Get empty value..


Forum|alt.badge.img+9
  • Nintex Partner
  • October 26, 2017

Can you try with the following line :

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