Kendo

  • Kendo UI
  • Demos
  • Roadmap
  • Download Beta

Skin

  • Framework
  • UI Widgets
  • Integration

    Configuration API Functions
    • The pane index:
    • Functions:

    Left pane

    Right pane

    • Description
    • View Code
    • Configuration (2)
    • Methods (6)
    • Events (4)

    The Splitter widget provides an easy way to create a dynamic layout of resizable and collapsible panes. The widget converts the children of an HTML element in to the interactive layout, adding resize and collapse handles based on configuration. Splitters can be mixed in both vertical and horizontal orientations to build complex layouts.

    Getting Started

    Create a root HTML div element with children that will become panes

    <div id="splitter">
       <div>
           Area 1
       </div>
       <div>
           Area 2
       </div>
    </div>

    Initialize the Splitter using a jQuery selector

      $("#splitter").kendoSplitter();

    When the Splitter is initialized, a vertical split bar will be placed between the two HTML divs. This bar can be moved by a user left and right to adjust the size on the panes.

    Configuring Splitter Behavior

    Splitter provides many configuration options that can be easily set during initialization. Among the properties that can be controlled:

    • Min/Max pane size
    • Resizable and Collapsible pane behaviors
    • Orientation of the splitter

    Pane properties are set for each individual pane in a Splitter, whereas Splitter properties apply to the entire widget.

    Setting Splitter and Pane properties

      $("#splitter").kendoSplitter({
          panes: [{
              min: "100px",
              max: "300px",
              collapsible: true
          },
          {
              collapsible: true
          }],
          orientation: "vertical"
      });

    Nested Splitter Layouts

    To achieve complex layouts, it may be necessary to nest Splitters in different orientations. Splitter fully supports nested configurations. All that is required is proper HTML configuration and multiple Kendo Splitter initializations.

    Creating nested Splitter layout

      <!-- Define nested HTML layout with divs-->
      <div id="horizontalSplitter">
          <div><p>Left Side Pane Content</p></div>
          <div>
              <div id="verticalSplitter">
                  <div><p>Right Side, Top Pane Content</p></div>
                  <div><p>Right Side, Bottom Pane Content</p></div>
              </div>
          </div>
      </div>

      //Initialize both Splitters with the proper orientation
      $(document).ready(function(){
          $("horizontalSplitter").kendoSplitter();
          $("verticalSplitter").kendoSplitter({orientation: "vertical"});
      });

    Loading Content with Ajax

    While any valid technique for loading Ajax content can be used, Splitter provides built-in support for asynchronously loading content from URLs. These URLs should return HTML fragments that can be loaded in a Splitter pane. Ajax content loading must be configured for each Pane that should use it.

    Loading Splitter content asynchronously

      <!-- Define the Splitter HTML-->
      <div id="splitter">
          <div>Area 1 with Static Content</div>
          <div> </div>
      </div>

      //Initialize the Splitter and configure async loading for one pane
      $(document).ready(function(){
          $("#splitter").kendoSplitter({
              panes: [null,{ contentUrl: "html-content-snippet.html"}]
          });
      });
    No code
    orientation: String(default: horizontal)
    Specifies the orientation of the splitter.
    "horizontal"
    Define horizontal orientation of the splitter.
    "vertical"
    Define vertical orientation of the splitter.
    panes: Array
    Array of pane definitions.

    Example

    $("#splitter").kendoSplitter({
         //definitions for the first three panes
         panes: [
             {
                 size: "200px",
                 min: "100px",
                 max: "300px"
             },
             {
                 size: "20%",
                 resizable: false
            },
            {
                 collapsed: true,
                 collapsible: true
            }
         ]
      });
    collapsed: Boolean(default: false)
    Specifies whether the pane is initially collapsed.
    collapsible: Boolean(default: false)
    Specifies whether the pane can be collapsed by the user.
    contentUrl: Boolean(default: true)
    Specifies URL from which to load the pane content.
    max: String
    Specifies the maximum size of the pane.

    Resized pane cannot be bigger then the defined maximum size.

    min: String
    Specifies the minimum size of the pane.

    Resized pane cannot be smaller then the defined minimum size.

    resizable: Boolean(default: true)
    Specifies whether the pane can be resized by the user.
    scrollable: Boolean(default: true)
    Specifies whether the pane shows a scrollbar when its content overflows.
    size: String
    Specifies the size of the pane.

    The size can be defined in pixes or in percents.

    The size cannot be more than panes.max and less then panes.min.

    • ajaxRequest (pane, url)
      Loads the pane content from the specified URL.

      Example

      splitter.ajaxRequest("#Pane1", "/Home/Pane1Content.html");

      Parameters

      pane: Selector|DomElement|jQueryObject
      The pane whose content
      url: String
      The URL which returns the pane content.
    • collapse (pane)
      Collapses the specified Pane item

      Example

      splitter.collapse("#Item1"); //id of the first pane

      Parameters

      pane: Selector|DomElement|jQueryObject
      The pane, which will be collapsed.
    • expand (pane)
      Expands the specified Pane item

      Example

      splitter.expand("#Item1"); //id of the first pane

      Parameters

      pane: Selector|DomElement|jQueryObject
      The pane, which will be expanded.
    • max (pane, value)
      Set the maximum size of the pane.

      Example

      splitter.max("#Item1", "300px");

      Parameters

      pane: Selector|DomElement|jQueryObject
      The pane
      value: String
      The maximum size value.
    • min (pane, value)
      Set the minimum size of the pane.

      Example

      splitter.min("#Item1", "100px");

      Parameters

      pane: Selector|DomElement|jQueryObject
      The pane
      value: String
      The minimum size value.
    • size (pane, value)
      Set the size of the pane.

      Example

      splitter.size("#Item1", "200px");

      Parameters

      pane: Selector|DomElement|jQueryObject
      The pane
      value: String
      The new size of the pane.
    collapse
    Fires before a pane is collapsed.

    Event data

    pane : Element
    The collapsing pane
    contentLoad
    Fires when a request for the pane contents has finished

    Event data

    pane : Element
    The pane whose content has been loaded.
    expand
    Fires before a pane is expanded.

    Event data

    pane : Element
    The expanding pane
    resize
    Fires when a pane is resized

    Event data

    pane : Element
    The pane which is resized
    • Home
    • Kendo UI
    • Demos
    • Roadmap
    • Blogs
    • Forums
    • Documentation
    • FAQ
    • About
    • Follow us on Twitter
    • Subscribe to our RSS feed

    Kendo UI is powered by Telerik

    Copyright © 2011 Telerik Inc. All rights reserved.