Skip to main content

Hi,

dropdown in the repeating field gets populated via javascript when the page loads , but how do we get the same script update the newly created dropdown when we click on "Add new row" ?

I want to populate all the rows with the same dropdown data but for now only the first dropdown in the repeating control gets populated. I did try to call the JS Function on button click to run the below code but it only appends the data to the first row only .

Rep_ddl_T2_Code is javascript id for dropdown.

Extract of the code ( external include )

function(xmlDoc)

{

 parser = new DOMParser();
 xmlDoc = parser.parseFromString(xml,"text/xml");
 var dat = xmlDoc.getElementsByTagName("Title");
   for (i = 0; i < dat.length; i++) {
    option = '<option value="' + dat.childNodesi0].nodeValue + '">' + dat.childNodesi0].nodeValue + '</option>';
       NWF$('#'+ Rep_ddl_T2_Code).find('option').end().append(option)

}

}

To access controls inside Repeating section, one should add CSS classname to the control instead of using the ID of the control and access it by the CSS classname as shown below:

NWF$(".css-class-of-your-repeating-section .nf-repeater-row:last .css-class-of-your-dropdown-list select").append(options);

201949_pastedImage_3.png

Check this: https://community.nintex.com/message/22589?commentID=22589#comment-22589   


Thanks Chaitra !! Works like magic. thank you so much for pointing in the right direction.


And don't make my mistake using the Control CSS. It definitely should be the CSS Class where you have to add the selector CSS class name.


Reply