[New Feature] Draggable/droppable elements

Since it was a bit cluttered, I cleaned up the forum app example of draggable - droppable elements.

All of the original functionality should be restored. (There were many odd elements dropped on the page, which I removed. Apologies if this messed with any experimentation. Though I did it for the greater good :slight_smile:).

As well, to reduce some of the cluttering that happens with use, I added in a Housekeeping feature. This makes use of draggable-droppable elements to clear out old data by referencing a RepeatingGroup list of draggable examples.

3 Likes

Very nice demo @dan1. Thanks.

@emmanuel Is there any chance that this will be added? I would really like to know because this will affect some design decisions that I have to make now.

Also, I have found a bug with this: If a DroppableGroup contains an input, then this input cannot be focused on tablets when tapping on it. This can be seen in the same example:

That’s going to be tight in the coming weeks, so it’d be better to design your app without it for now.

1 Like

I want to use these elements to create annotations on an image. In this case a vehicle damage report where you generate new draggable ring-shaped elements which you can drag and drop on a background image of a car (from different sides). The elements refer to a comment about that particular damage.

The next step is to print a screenshot (using screenshotlayer API) that gets saved as a png and used to populate a PDF template with all the damage information.

As outlined above, its crucial to save the position because when the screenshot is taken, the page is reloaded.

Would the option of saving the offset (I will use a static page) as items in a DB still be a possibility or would I have to try with saving the index of cell like @emmanual mentioned?

Being able to save the exact positions of the draggable items would open a lot more opportunities, especially when it comes to annotation of things. (images, files, other elements etc)


For the index solution to work, would you have to change the RG source to number and then refer to the cells index? Whenever I try to make changes to the thing I created that is inside the draggable group I cannot refer to the current cell’s index to store it to a field on the thing.

I’m using the forum app ‘good’ ‘bad’ as an example but get stuck on that point. @romanmg did you ever get this to work?

1 Like

Hi @vincent56, no, I wound up removing that feature. I think if you study some of examples around the forum relating to kanban-style boards, you may get some tips on how to make saving dragged elements work. Some links here: Need help creating a Kanban board in my app

Thanks I’ll have a look. Additional keywords to search the forum, that is always helpful. Although I’m not sure if they solve the problem of needing to save the element at exactly the same spot on the canvas…

I’m trying to make the kind of instruction boxes that move around like in Bubble’s tutorials. I would like to each one as a database entry with an index, the text and the position either as x and y or as the object being explained. But, according to above this is not supported.

So, how do you do it in the Bubble tutorials?

2 Likes

@emmanuel Any chance of opening source code of the plugin? :wink:

No we cannot, as it’s not on the public plugin API.

Hi @vincent56 , regarding your comment:

I’m trying to do a very similar thing and thought I would check if you found a solution?

Hi @jarrod.tuxworth

There are some plugins available today that could help with this but in the end I decided to use the signature pad plugin and use an image as background. I would draw on the image and save the new image without the background. I then use selectpdf to print the actual report with the drawings pasted as an image over a new background of the same size in the report page.

I’m actually in the middle of transitioning to a new print solution (made by @jarrad) but this still works for me.

@vincent56 ah i see. I’m not sure that’s going to suit my use case unfortunately.

I’m trying to do something like this: https://www.ifloorplan.com/

where you hover over or select the various icons and it shows details (picture + other fields) associated with a thing.

Any tips on a plugin that could meet my use case?

1 Like

If it is just hovering over fixed groups, you can very easily achieve that with the standard tools.

yes but the thing is the user needs to be able to place those icons anywhere they like on the picture and the icon needs to save to that place.

1 Like

There is a plugin called ‘mousey’ that tracks the x and y coordinates which you can store as a thing. That could pretty easily do what you have in mind.

Thanks for your help - I’ll give it a try.

depending on how in depth your trying to go this looks cool for a simple tool… http://avirtum.com/demo/ipanorama/builder/index.html

We just added a way to save the position of a dragged element and use this with the Move element action.

34 PM

7 Likes

@bubble OMG you guys ROCK! I needed this SO BAD!!!

1 Like