cancel
Showing results for 
Search instead for 
Did you mean: 

Draggable Button in UI5

0 Kudos

Is there any way to make a button or any control draggable in UI5?

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

Whats the UI5 version the app is running with?

0 Kudos

Hi Boghyon,


Thanks for your prompt response.

The UI5 version is 1.38.20.

Thanks & Regards
Sagar Bansal

priteshpatel65
Active Participant
0 Kudos

Draggable Button

hey sagar,

use this code in Your controller "#btn" is a html ID of your control.

is this code work fine for me.

Using this code make any control draggable

$("#btn").draggable({
        cancel : false
      });

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor

here is one that works (I think :-))

https://jsbin.com/nedikez/edit?html,js,output

It is tricky to have draggable for all controls. You have to extend them accordingly.

Thanks

Dennis

0 Kudos

Hi Dennis,

Thanks for your help.

It worked well.

Thanks & Regards
Sagar Bansal

Answers (1)

Answers (1)

mariusobert
Developer Advocate
Developer Advocate

Hi Sagar,

with the mentioned version you're able to follow the approach described here .

Please be aware that this snippet doesn't work with the most recent version of SAPUI5.

Regards,

Marius

0 Kudos

Hi Marius,

Thanks for your response.

I checked this approach but it seems like there is some problem with the code. It is not working on JS bin itself.

Thanks & Regards

Sagar Bansal

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

Hi Sagar,

the snippet didn't work because it uses the latest version of UI5. If you replace the bootstrap URL with

https://openui5.hana.ondemand.com/1.38.20/resources/sap-ui-core.js

it works.

dennis.seah was faster 🙂