Skip to main content
Nintex Community Menu Bar

How do you select the first or middle row of a repeating section using JavaScript?

  • June 22, 2020
  • 5 replies
  • 46 views

Forum|alt.badge.img+4

I have a repeating section that I am manipulating in various ways.  One of the ways I am doing so is by deleting the last row b using the following Javascript:

 

NWF$('.rsdata .nf-repeater-row:last').find('.nf-repeater-deleterow-image').click();

(The CSS of the repeating section is "rsdata".)

 

I am also trying to delete the first row of the repeating section.  I've tried to change "last" for "first" but that has not worked.  Also, I am trying to delete a row in the middle (not the first or last).  Is there a way to delete it using a sort of "indexing" method?  Any help is appreciated!

 

Thank you,

Owen

5 replies

Forum|alt.badge.img+8
  • Novice
  • June 23, 2020

Hi @odennis1,

I´d recommend playing in your browsers dev tools on what is returned when you execute

NWF$('.rsdata .nf-repeater-row')

 You should reveice an array of all repeater-rows in the rsData Container (the repeating section). With this, you have all the indexing methods you need.


Forum|alt.badge.img+4
  • Author
  • Novice
  • June 24, 2020

Thank you for the response @Tarf. Where in the Development tools do I need to go to find that executable? I've used the search tool on almost every script and cannot find it.


Forum|alt.badge.img+8
  • Novice
  • June 25, 2020

Hi @odennis1,

in Chrome you can access the dev tools using F12 -> Console -> start typing.
But that differs from browser to browser


Forum|alt.badge.img+3
  • Rookie
  • August 7, 2020

Thanks for your unintended help.

I needed the code - I had been trying to find how to delete a row. Since Nintex Forms doesn't allow a button for "Delete" to be put onto each row in the repeating section, I give the option to "Delete Last Row" with a button. You gave me the code - I just have to use the correct repeater CSS name.

NWF$('.rsdata .nf-repeater-row:last').find('.nf-repeater-deleterow-image').click();

Thanks again!


Forum|alt.badge.img+4
  • Author
  • Novice
  • August 7, 2020
Happy to unintentionally help! Good luck with your code!