Autocomplete on added row in nested repeating section


Badge +1

Hi,

I followed Autocomplete in a repeating section  and that works just fine 
On opening the form it also works on nested repeating sections.
(A repeating section in a repeating section also gets the autocomplete set)

However it does not work when a row is added.
I add this in the rowadded :

var field_control_id = repeaterRow.find('.' + fieldClassName).attr("id");
NWF$("#" + field_control_id).autocomplete({ source: elements });

This works for the main repeating section

However it does not work for a nested repeating section !
The field_control_id is found and the autocomplete is executed, however in the form there is no autocomplete functionality !

All feedback and help greatly appreciated

Thanks

Danny


3 replies

Userlevel 5
Badge +14

have never tested it, but basically your selector should search first for an inner repeating section control within current row being added to outer repeating section, and just then for a specific control within inner repeating section.

Badge +1

Thanks for your reply

However, it addresses the case of 'setting the inner repeating section's field autocomplete when adding an outer repeating section row' 

My question was, admittedly not very clear, 'setting an inner repeating section's field autocomplete when adding an row of that same inner repeating section'. 
In that case I receive the repeaterrow from the rowadded event : 

            repeaterRow = NWF$(arguments[0][0]);
So, one would assume that this :
var field_control_id = repeaterRow.find('.' + fieldClassName).attr("id");
NWF$("#" + field_control_id).autocomplete({ source: elements });
works. But it doesn't.

And just to be clear : above works fine when in the case of : setting an outer repeating section's field autocomplete when adding an row of that same outer repeating section'. 

Thanks again 
Badge +1

I included a recent jquery and jquery-ui and worked with that : it works

Don't know if there will be side-effects though ....

Reply