简体   繁体   English

如何修复仪表板插件中的小部件?

[英]How to fix a widget in the dashboard plugin?

I am trying to adjust the plugin demoed here http://www.gxdeveloperweb.com/dashboardplugin/demo/dashboard.html to my needs. 我试图根据我的需要调整此处http://www.gxdeveloperweb.com/dashboardplugin/demo/dashboard.html演示的插件。

The most urgent thing is that widgets must have parameter(in config file for example) – widget position is "fixed" or "not fixed" on the scheme. 最紧急的事情是,小部件必须具有参数(例如,在配置文件中)–方案中小部件的位置“固定”或“不固定”。

So how could i do that and how to make a widget not draggable? 那么我该怎么做以及如何使小部件不可拖动?

Many thanks in advance! 提前谢谢了!

You can just add have the items property and only have the items that do not have the fixed class. 您可以仅添加具有items属性,而仅包含不具有固定类的项目。

Here is a fiddle: http://jsfiddle.net/MadLittleMods/DUSKm/ 这是一个小提琴: http : //jsfiddle.net/MadLittleMods/DUSKm/

As well as the simple code here: 以及这里的简单代码:

jQuery: jQuery的:

$('#container').sortable({
    items: '.item:not(.fixed)'
});
$('#container').disableSelection();
​

HTML: HTML:

<div id="container">
    <div class="item">Item 1</div>
    <div class="item">Item 2</div>
    <div class="item fixed">Item 3</div>
    <div class="item">Item 4</div>
</div>​

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM