Telerik MVC : Creating an "ExtJS border-layout" with Splitters

This website is no longer actively supported

Written by John DeVightJohn DeVight on 24 Jun 2011 12:28

Download RAZOR Source Code
Download ASPX Source Code
* Note: the Telerik.Web.Mvc.dll, Telerik "Contents" and Telerik "Scripts" have all been removed to reduce the zip file size


ExtJS has a really nice Layout Manager that can be used to create a nice desktop application look-and-feel to a web application. The same can be accomplished with the Telerik Splitter extension and a little bit of jQuery.

What you will end up with in the end is this:


Creating the (_Layout.cshtml or Site.Master) Page

The (_Layout.cshtml or Site.Master) page contains an outer splitter and an inner splitter. The outer splitter (or main splitter) creates a "pane" at the top of the page for the heading and a "pane" for the rest of the page for the content. The "content pane" contains the inner splitter with a pane on the left for navigation and a pane on the right for the page content.

Here is the markup:

@using Telerik.Web.Mvc.UI;
<!DOCTYPE html>
        .DefaultGroup(group => group.Add("telerik.common.css")

    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

    <div id="page">
        <div id="main">
                    .HtmlAttributes(new { style = "height: 300px;" })
                    .Panes(vPanes =>
                            @* Added the following HTML styles to allow the menu to display over top of all other div's.
                             * overflow:visible - needed for Firefox 3.x and IE 8.
                             * position:absolute; z-index:100; - needed for IE 7.
                            .HtmlAttributes(new { style = "overflow:visible; position:absolute; z-index:100;" })
                                    <div class="splitterContent" style="width:100%;"><h1>My Application</h1></div>

                                .HtmlAttributes(new { style = "height: 100%; width: 100%; border: 0; overflow: hidden;" })
                                .Panes(hPanes =>
                                        .Content(@<h2>Navigation Here</h2>);

                                        .Content(@<div class="splitterContent">@RenderBody()</div>);

                            .Content(@<div class="splitterContent"></div>);


            .Scripts(scripts =>
                scripts.AddGroup("LayoutGroup", group =>



Creating the Layout.js

The Layout javascript class contains the Layout.Init function that resizes the main splitter and also subscribes to the window's resize event so that the main splitter is resized whenever the browser is resized.

Here is the code:

var Layout = {};

Layout.Init = function() {

Layout.MainSplitter_Resize = function() {
    var height = $(window).height();
    var splitter = $('#MainSplitter');
    splitter.height(height - 25);


Discussion Closed

Add a New Comment

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License