We are working on autocomplete with dynamically inserted elements with jquery (did autocomplete on static elements before). Here is the html source code for one autocomplete add
setTimeout solves the problem:
setTimeout(function(){
$("[id^='requisition_material_items_attributes_'][id$='_item_name_autocomplete']").each(function (){
$(this).autocomplete({
minLength: 1,
source: $(this).data('autocomplete-source'),
select: function(event, ui) {
$(this).val(ui.item.value);
}
});
});
}, 5000);