gpt4 book ai didi

javascript - 如何在 kendo ui 中拖放面板栏?

转载 作者:行者123 更新时间:2023-11-30 08:54:02 25 4
gpt4 key购买 nike

在我的项目中,我需要拖放带有图表的面板栏,是否可以拖放?如果可能的话,任何人都可以提供剑道 ui 中的示例

最佳答案

Kendo UI Widget(非官方)可以简化您的开发。

如果您将面板内容定义为:

<div class="panel-container">
<div class="panel">
<ul id="panelbar0" class="ob-panel-bar">
<li class="k-state-active">
<span class="k-link k-state-selected">Graph #0</span>
<div><div>Hello, world!</div><div>Hello, world!</div><div>Hello, world!</div></div>
</li>
</ul>
<ul id="panelbar1" class="ob-panel-bar">
<li class="k-state-active">
<span class="k-link k-state-selected"> Graph #1</span>
<div><div>Hello, world!</div><div>Hello, world!</div><div>Hello, world!</div></div>
</li>
</ul>
<ul id="panelbar2" class="ob-panel-bar">
<li class="k-state-active">
<span class="k-link k-state-selected"> Graph #2</span>
<div><div>Hello, world!</div><div>Hello, world!</div><div>Hello, world!</div></div>
</ul>
<ul id="panelbar3" class="ob-panel-bar">
<li class="k-state-active">
<span class="k-link k-state-selected"> Graph #3</span>
<div><div>Hello, world!</div><div>Hello, world!</div><div>Hello, world!</div></div>
</li>
</ul>
<ul id="panelbar4" class="ob-panel-bar">
<li class="k-state-active">
<span class="k-link k-state-selected"> Graph #4</span>
<div><div>Hello, world!</div><div>Hello, world!</div><div>Hello, world!</div></div>
</li>
</ul>
<ul id="panelbar5" class="ob-panel-bar">
<li class="k-state-active">
<span class="k-link k-state-selected"> Graph #5</span>
<div><div>Hello, world!</div><div>Hello, world!</div><div>Hello, world!</div></div>
</li>
</ul>
</div>
</div>

以及以下用于初始化面板的 JavaScript:

$("#panelbar0").kendoPanelBar({
expandMode: "multiple"
});
$("#panelbar1").kendoPanelBar({
expandMode: "multiple"
});
$("#panelbar2").kendoPanelBar({
expandMode: "multiple"
});
$("#panelbar3").kendoPanelBar({
expandMode: "multiple"
});
$("#panelbar4").kendoPanelBar({
expandMode: "multiple"
});
$("#panelbar5").kendoPanelBar({
expandMode: "multiple"
});

你只需要添加:

$(".panel-container").kendoOBSortableGrid({
hint: function (element) {
return element.clone().addClass("ob-being-dragged");
}
});

在此处查看演示:http://jsfiddle.net/OnaBai/WxUUL/

关于javascript - 如何在 kendo ui 中拖放面板栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15266582/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com