Is there a way with Javascript (Toolbox plugin) to duplicate or clone a shape (ID=a) (where you can set the number of copies) relative to another shape (ID=b)?
If this can be done, is there also a possibillity to give all the cloned shapes with ID=a an offset (width and height)?
I don’t think there’s a way to do that. However, if you elaborate a bit on the problem you’re trying to solve, perhaps there’s a workable approach using repeating groups or other means. RG’s are the Bubble-native way to create rows, columns, or grids of repeating elements.
Also, your description seems to imply that multiple elements would have the same ID, and that’s a big no-no. (I might be misunderstanding what you’re describing though.)
Ok, that’s a bummer…but…maybe I can (as you said) do it with the RG’s. If I can control the amount of rows and columns, change the width and height all based on data which is already in the database I don’t know if that’s possible in Bubblle…
What I am creating here is an invoice application for companies who sell solarpanels. The user needs to type in the dimension of the roof (which can be the boundaries of the RG), then select the panels (the dimension of those chosen panel is already in the database) and they choose the number of panels. The settings such as width, height, columns, rows and the cell background of the RG has to be controlled based on inputs… There has to be a way to visualize a roof with panels…
Now that I better understand what you’re trying to accomplish, I don’t think RGs are the right approach. They really weren’t designed for “visualizations” in that sense. AKAIK, there is no way to control an RG’s dimensions explicitly using Bubble logic; and attempts to do so via JS would be a constant battle with Bubble’s layout engine.
The first thing that comes to mind is a custom plugin that uses a plain old “table” element and exposes actions for setting row, column, and cell height.
It seems like an interesting project though. Perhaps someone else has some clever idea.
hmmm… then this is gonna be harder than I thought it would be…
Well, I was thinking about an iFrame, but that makes no sense I think, because I need to load external functionalities and connect it to my Bubble database, so that’s a no-go
A table element is an option maybe…I’ll go check that possibility out…
Thanks, yeah it is, especially for a graphic designer hahaha, but I managed to come this far already. The only things I need to do is make the application multi tennant and to make a step-by-step calculation/invoice module where users can insert client data and pick models etc… somewhere in the calculation module I need to fix this litte tool.
I hope somebody does have another possibility to fix this piece of functionality…
But, thanks for you opinion and your time! Appreciate it!
Is every cell exactly the same dimensions for a given roof, or can there be cells (solar panels) of various sizes within a single “grid”?
Yes indeed! You can choose one (panel) model from a dropdown and use it to cover the dimensions of the roof. Offcourse, you shouldn’t be able to place more panels if the roof isn’t large enough…