Open popup from reusable element (NEED HELP)

Hello Group,

i need help how i can open popup window from menu which is made like reusable element. The popup is not on the same page like reusable element.

i dont find direct video tutorial.

i have create this:

download and delete cell from the repeating group work but with the edit i need open popup. which is not created in the same page like the menu element.

Create a re-usable popup and call that inside the re-usable (add as an re usable element)

I would use the Toolbox plugin for this…

Just put a JavaScript to Bubble element on your page, which is set to trigger an event, and when that event triggers, open the popup.

Then, in your RE, just use a run JavaScript action and call the function of the JavaScript To Bubble Element.

Alternatively you can put the popup inside the RE itself (although, for several reasons, I’m not the biggest fan of doing it that way).

Interesting, could you expound more on this @adamhholmes ?

Is it more about the technical side like I know adding a lot of popups would dramatically slow down the app since it is loaded on page load or when the RE is loaded or used or is it more of a managing the editor type of issue?

Well, in theory elements not visible on page-load aren’t meant to be included in the DOM until they become visible (or have their data referenced), so that shouldn’t be an issue (they used to be, so that used to be a much bigger issue) - but I have recently noticed cases where that’s not the case, and non-visible elements are included in the DOM, especially when RGs are involved.

One of the issues is with debugging…

If you have a popup inside the RE, and that RE is placed inside the cell of an RG that has, say, 40 rows of data, then even though those 40 instances of the popup shouldn’t be included in the DOM (although in some cased they may be), there will still be 40 individual instances of that popup shown in the debugger (and not always in the same order they appear in the RG)…

So trying to debug an issue with the popup in Bubble’s debugger can rather difficult, especially if the popup (or other element) is not visible at the time, when there are 40 instances of the same popup, all with the same name - I find it makes it very hard, and time consuming, to find the one you’re trying to debug. Maybe not a huge issue with a simple popup, but for more complex operations, being able to debug efficiently is crucial.

But above all, I just find it cleaner, and simpler to just have a single popup (instead of 40 of them), and it’s more similar to how I’d do things outside of Bubble (nowadays, as much as possible, I try to do things in Bubble as close to how i would do them outside of Bubble - although that’s not always possible, or WU efficient.).

1 Like

I can’t imagine adding popups to each cell of an RG :joy:

Thanks for the insights Adam.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.