Can we force the Kendo to change the "collapsible: false" property of splitter to "collapsible: true" on click of a button??

On load, if the Splitter property "collapsible" is set to "false", then the user cannot collapse it back..

So is there anyway if I set the property "collapsible:false" but on click of the button at run time change the property to "collapsible:true" and then collapse and then set it back to "collapsible:false"???

Here is my code:

HTML

<p>
    <button id="collapsePane" type="button" class="k-button">Collapse left pane</button>
    <button id="expandPane" type="button" class="k-button">Expand left pane</button>
</p>
<div id="splitter">
    <div id="left">Left column</div>
    <div>Main content</div>
</div>

JS

var splitterElement = $("#splitter").kendoSplitter({
    panes: [{
        size: "15%",
        resizable: true,
        collapsible: false,
    }, {
        size: "85%",
        resizable: true,
    }]
});


var splitter = splitterElement.data("kendoSplitter");

$("#collapsePane").click(function (e) {
    var splitter = $("#splitter").data("kendoSplitter");
    $("#left").collapsible(true);  /*How to change this property?*/
    splitter.collapse("#left");
});

$("#expandPane").click(function (e) {
    var splitter = $("#splitter").data("kendoSplitter");
    splitter.expand("#left");
});

Here is the Link for the demo of my code: http://jsfiddle.net/hxtxokoq

Please suggest and let me know if you need any other details.

Thanks in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

Try changing your $("#left").collapsible(true); to:

splitter.options.panes[0].collapsible = true;

Updated jsfiddle: http://jsfiddle.net/4w7k3gz3/3/

Edit: And here's the documentation used to find a solution: http://docs.telerik.com/kendo-ui/web/splitter/overview#change-pane-settings-after-initialization