Disable Widget Dragging on the Dashboard Theme

1001
1
Jump to solution
04-01-2019 06:34 AM
jonataspovoas
New Contributor III

Hi,

I'm building an aplication with the Web AppBuilder Developer, using the Dashboard Theme, and my client requested that I disable the capability to drag widgets to change the application design during execution.

0 Kudos
1 Solution

Accepted Solutions
jonataspovoas
New Contributor III

I got it done by changing the DragListener class in the Golden Layout.

In the goldenlayout.js file, the script creates an e.utils.DragListener. On the onMouseDown function I added the following condition:

if (t.toElement.className == "lm_drag_handle")

With this, the drag doesn't listens the event while clicking on the header of the widgets, and will still work when trying to resize the widgets area.

View solution in original post

1 Reply
jonataspovoas
New Contributor III

I got it done by changing the DragListener class in the Golden Layout.

In the goldenlayout.js file, the script creates an e.utils.DragListener. On the onMouseDown function I added the following condition:

if (t.toElement.className == "lm_drag_handle")

With this, the drag doesn't listens the event while clicking on the header of the widgets, and will still work when trying to resize the widgets area.