I have build a search/result page with FacetWP and ACF.
On the result page I add the possibility to edit one specific repeater fields for each result listed.
To do that I include in the FacetWP loop this code:
<?php
$options = array(
'id' => 'acf-form_'.$post->ID,
'post_id' => $post->ID,
'post_title' => false,
'post_content' => false,
'field_groups' => array('group_6166044822675'),
'fields' => array('field_6166066864387'),
);
acf_form($options);
?>
On the main page the button “add row” work well.
When with a Facet I refine the result to show only the post from October 2021 or any other specification, FacetWP import the new search result via ajax. But this time if I click on a “add row” button, nothing happen.
The javascript and the new HTML code imported via ajax by FacetWP are not binded.
There are many answers about binding problem but I can't find how to solve it because the ACF function has no name.
! function() {
var t = {
...
945: function() {
! function(t) {
var e = acf.Field.extend({
type: "repeater",
wait: "",
events: {
'click a[data-event="add-row"]': "onClickAdd",
'click a[data-event="duplicate-row"]': "onClickDuplicate",
'click a[data-event="remove-row"]': "onClickRemove",
'click a[data-event="collapse-row"]': "onClickCollapse",
showField: "onShow",
unloadField: "onUnload",
mouseover: "onHover",
unloadField: "onUnload"
}, ...
Is there a way to target this function ?