Resize

21 Dec 20224 minutes to read

By default, resizing will be enable for split panes. Resizing gripper element will be add to the separator to makes the resize easy.

NOTE

Horizontal splitter will allows to resize in horizontal directions.

Vertical splitter will allows to resize in vertical directions.

While resizing, previous and next panes will be adjust its dimensions automatically.

Min and Max validation

Splitter allows you to set the minimum and maximum sizes for each pane. Resizing will not be occur over the minimum and maximum values.

@Html.EJS().Splitter("splitter").Width("600px").Height("200px").PaneSettings(item => {
    item.Size("200px").Min("20%").Max("40%").Content("<div class='content'><h4 class='h4'>Grid</h4>The ASP.NET DataGrid control, or DataTable is a feature-rich control used to display data in a tabular format.</div>").Add();
    item.Size("200px").Min("30%").Max("60%").Content("<div class='content'><h4 class='h4'>Schedule </h4>The ASP.NET Scheduler, a.k.a. event calendar, facilitates almost all calendar features, thus allowing users to manage their time efficiently.</div>").Add();
    item.Size("200px").Content("<div class='content'><h4 class='h4'>Chart </h4>ASP.NET charts, a well-crafted easy-to-use charting package, is used to add beautiful charts in web and mobile applications").Add();
 }).Render()
<style>
    .content {
        padding: 9px;
    }

    .h4 {
        font-weight: 550;
    }
</style>
public class HomeController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}

Prevent resizing

You can disable the resizing for the pane by setting false to the Resizable API within PaneSettings.

@Html.EJS().Splitter("splitter").Width("600px").Height("200px").PaneSettings(item => {
   item.Size("200px").Min("20%").Max("40%").Resizable(false).Content("<div class='content'><h4 class='h4'>Grid</h4>The ASP.NET DataGrid control, or DataTable is a feature-rich control used to display data in a tabular format.</div>").Add();
   item.Size("200px").Min("30%").Max("60%").Content("<div class='content'><h4 class='h4'>Schedule </h4>The ASP.NET Scheduler, a.k.a. event calendar, facilitates almost all calendar features, thus allowing users to manage their time efficiently.</div>").Add();
   item.Size("200px").Content("<div class='content'><h4 class='h4'>Chart </h4>ASP.NET charts, a well-crafted easy-to-use charting package, is used to add beautiful charts in web and mobile applications").Add();
}).Render()
<style>
    .content {
        padding: 9px;
    }

    .h4 {
        font-weight: 550;
    }
</style>
public class HomeController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}

Output be like the below.

Prevent resizing

Refresh content on resizing

While resizing the panes, you can refresh the pane contents by using either ResizeStart , Resizing or ResizeStop events.

Customize the resize grip and cursor

You can customize the resize gripper icon and cursor in css level.

<div class="control_wrapper">
    @Html.EJS().Splitter("splitter").Width("600px").Height("200px").PaneSettings(item => {
       item.Size("200px").Min("20%").Max("40%").Content("<div class='content'><h4 class='h4'>PARIS </h4>Paris, the city of lights and love - this short guide is full of ideas for how to make the most of the romanticism...</div>").Add();
       item.Size("200px").Min("30%").Max("60%").Content("<div class='content'><h4 class='h4'>CAMEMBERT </h4>The village in the Orne département of Normandy where the famous French cheese is originated from.</div>").Add();
       item.Size("200px").Content("<div class='content'><h4 class='h4'>GRENOBLE </h4>The capital city of the French Alps and a major scientific center surrounded by many ski resorts, host of the Winter Olympics in 1968.</div>").Add();
    }).Render()
</div>
<style>
    .content {
        padding: 9px;
    }

    .h4 {
        font-weight: 550;
        font-size: 15px;
    }

    .control_wrapper .e-splitter .e-split-bar .e-resize-handler:before {
        content: "\e934";
        font-family: 'e-icons';
        font-size: 11px;
        transform: rotate(90deg);
    }

    .e-splitter .e-split-bar.e-split-bar-horizontal.e-resizable-split-bar,
    .e-splitter .e-split-bar.e-split-bar-horizontal.e-resizable-split-bar::after {
        cursor: e-resize;
    }
</style>
public class HomeController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}

Output be like the below.

Customize the resize grip and cursor

See Also