Introduction
Kendo splitter is a widget that is used to split two elements in an HTML page. In this blog, we will see how to implement Kendo Splitter with the static data in an HTML page.
Kendo Splitter
The initial step in the kendo splitter is to configure the orientation.
KendoSplitter.html
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled</title>
-
- <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.common.min.css">
- <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.rtl.min.css">
- <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.default.min.css">
- <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.mobile.all.min.css">
-
- <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
- <script src="https://kendo.cdn.telerik.com/2018.3.1017/js/kendo.all.min.js"></script></head>
- <body>
- <div id="splitter">
- <div>Splitter Pane A</div>
- <div>Splitter Pane B</div>
- </div>
- <script>
- $("#splitter").kendoSplitter({
- orientation: "vertical"
- });
- </script>
- </body>
- </html>
From the above code, you can notice that the kendoSplitter object is used to initialize the kendo splitter for the HTML element.
The orientation property is used to set the splitter as vertical or horizontal.
Result
Orientation – vertical
Orientation – horizontal
- $("#splitter").kendoSplitter({
- orientation: "horizontal"
- });
You can even add the collapse feature to the splitter. So, by clicking on the collapse icon, we can define how much the pane should be collapsed using the collapsed Size property.
- $("#splitter").kendoSplitter({
- orientation: "horizontal",
- panes: [ { collapsible: true, collapsedSize: "10%" }, {} ]
- });
The collapsible property is used to enable the collapse feature in the splitter.
https://demos.telerik.com/kendo-ui/splitter/index
I hope you have enjoyed this blog. Your valuable feedback, questions, or comments about this article are always welcomed.