0

想要动态地将新窗格添加到 kendo ui 拆分器,但它似乎不起作用。即使在他们的网站上它也不起作用:Kendo ui splitter demo(我说的是附加窗格和插入窗格)

他们是否有可能添加了一些不起作用的演示,或者我错过了什么?

4

1 回答 1

1

这是一个错误 - 显然,代码没有_resize在应该调用该方法时(在_addPaneandremove中,据我所知)。

不过似乎很容易解决(在第一次创建拆分器之前将此代码添加到某处):

kendo.ui.Splitter.fn._addPane = function (config, idx, paneElement) {
    var that = this;

    if (paneElement.length) {
        that.options.panes.splice(idx, 0, config);
        that._initPane(paneElement, config);

        that._removeSplitBars();

        that.trigger("resize");
        that._resize();
    }

    return paneElement;
};

kendo.ui.Splitter.fn.remove = function (pane) {
    pane = $(pane);

    var that = this;

    if (pane.length) {
        kendo.destroy(pane);
        pane.each(function (idx, element) {
            that.options.panes.splice($(element).index(".k-pane"), 1);
            $(element).remove();
        });

        that._removeSplitBars();

        if (that.options.panes.length) {
            that.trigger("resize");
            that._resize();
        }
    }

    return that;
}

看演示

于 2014-01-02T19:32:25.707 回答