1

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

4

1 回答 1

5

有可以简化您的开发的 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/

于 2013-03-07T12:17:55.000 回答