Is there a way to disable drag&drop in dashing?

删除回忆录丶 提交于 2019-12-11 13:37:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!