This is a migrated thread and some comments may be shown as answers.

[Bug Report] Removing splitter panes in v2013.3.1119

1 Answer 8 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 15 Jan 2014, 01:12 AM
I believe there may be a bug in the way panes are removed from splitter IF there are more that one splitter on the page.  The following is the remove method from kendo.splitter.js in v2013.3.1119:

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.resize();
        }
    }
 
    return that;
},
If there is only one splitter on the page, $(element).index(".k-pane") will return the appropriate index of the pane.  If there are more than one splitter on the page, the ".k-pane" selector will return panes for ALL the splitters on the page (not just the splitter in question) and the element's index within that jquery object will NOT correspond to the index in the that.options.panes array.  I haven't tried it but I think that the following would eliminate the erroneous panes:
that.options.panes.splice($(element).parent().children(".k-pane").index($(element)),
1);


1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 Jan 2014, 10:36 AM
Hello Mark,

Indeed, the index was not calculated correctly. This issue is now fixed and changes will take effect in the service pack, which is scheduled to be released this week. I have updated your Telerik points. Thank you.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Splitter
Asked by
Mark
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or