问题
Tried to dig through the JS, but it's above my head. IMO with many dashboards it does not make sense to rearrange things.
回答1:
You can disable dragging by adding an items
parameter in your assets/javascripts/application.coffee
file and setting it to 'none' like so:
draggable:
stop: Dashing.showGridsterInstructions
start: -> Dashing.currentWidgetPositions = Dashing.getWidgetPositions()
items: "none"
The items
parameter takes a string that matches a CSS selector. It can also take a collection of HTML elements. Only matching elements will be draggable. You can pass any string, as long as it doesn't match any of your widgets. In this case, no elements are matching, which means that drag isn't enabled for anything.
来源:https://stackoverflow.com/questions/30513122/is-there-a-way-to-disable-dragdrop-in-dashing