You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all you should not set locked property directly (internal) but make the api call update(widget, {locked:true}) as there is more to it than setting the flag.
second, locked = noMove (user) + noSize (user) + can't be moved by collision constrain by another widget by design. that is the expected behavior.
Thank you for the information. I will use the update function. However I am still confused on the expected behavior of a 'locked' widget. According to the API:
locked - means another widget wouldn't be able to move it during dragging or resizing. The widget can still be dragged or resized by the user. You need to add noResize and noMove attributes to completely lock the widget.
(https://github.com/gridstack/gridstack.js/tree/master/doc#item-options)
so shouldnt a locked widget be able to be moved/resized by the user?
I stand corrected. in v0.5 (the furthers I went back that I worked on) locked can still be dragged by the user.
this broke in v1.1.1 (ok in v1.1.0) as I assumed locked meant no move by user either.
not sure what the use case is for... weird that items will not get pushed out but user can still manually do it.
Activity
adumesny commentedon May 27, 2021
first of all you should not set locked property directly (internal) but make the api call
update(widget, {locked:true})as there is more to it than setting the flag.second, locked = noMove (user) + noSize (user) + can't be moved by collision constrain by another widget by design. that is the expected behavior.
ztessema commentedon May 27, 2021
Thank you for the information. I will use the update function. However I am still confused on the expected behavior of a 'locked' widget. According to the API:
so shouldnt a locked widget be able to be moved/resized by the user?
ztessema commentedon May 27, 2021
More generally, how would I acheieve the behaviour of preventing the widget from being moved by the move/resize of other widgets?
adumesny commentedon May 27, 2021
I stand corrected. in v0.5 (the furthers I went back that I worked on)
lockedcan still be dragged by the user.this broke in v1.1.1 (ok in v1.1.0) as I assumed locked meant no move by user either.
not sure what the use case is for... weird that items will not get pushed out but user can still manually do it.
`locked` item can be moved/resized
`locked` item can be moved/resized
adumesny commentedon May 29, 2021
fixed in next release. if you find this lib useful, don't forget to donate!