This example shows how to use the client-side API of Telerik Splitter for ASP.NET MVC.
To use the client-side API you should first retrieve the splitter client-side object. The following code snippet shows how to do this:
<script type="text/javascript">
function getSplitter(){
// "Splitter" is the value specified by the Name() method.
var splitter = $("#Splitter").data("tSplitter");
return splitter;
}
</script>
The available client-side methods are:
splitter.expand(pane) - expands a pane.splitter.collapse(pane) - collapses a pane.splitter.ajaxRequest(pane [, URL]) - refreshes the content of a pane with specified content URL (load-on-demand).
If URL is specified, data is fetched from where it points to.splitter.toggle(pane [, shouldExpand]) - toggles the expanded/collapsed state of the pane.
If shouldExpand is specified, the pane gets expanded if it is true, and collapsed if it is false.
All of the above methods accept pane as either a DOM element, jQuery selector or a jQuery object.