Home Forums ACF PRO Trigger a blank row in a flex content on button click Reply To: Trigger a blank row in a flex content on button click

  • I’m replying because I don’t think that you’re going to get anything that will tell you exactly what to do. Working on the JS side of ACF is not something there is a lot of information about. I’m not even sure that what you’re trying to do is possible.

    If I had to do this I would start by looking in the file
    In this file on about line 523 you’ll find

    acf.fields.flexible_content = acf.field.extend({

    This is where the code for the flex field can be found. In this section you’ll find two functions that do this in ACF. _open is the function that opens the window and _add is the function that adds the layout. You’re going to have to somehow recreate what these two functions do.

    I’ve looked at it and to be honest, there’s too much work there for me to try it. Honestly, I wouldn’t go to that much trouble to save a user a click. There’d need to be a more important reason.