Skip to main content
A newer version of this page is available. .

ASPxClientSplitter.GetLayoutData Method

Returns a string value that represents the client state of splitter panes.

Declaration

GetLayoutData(): string

Returns

Type Description
string

A string that represents the splitter pane state.

Example

This example demonstrates how to preserve the MVC Splitter layout when an end-user expands, collapses or resizes its panes.  The Splitter extension is placed inside the CallbackPanel extension. In order to save its layout after a modification, you are required to handle corresponding client-side events and pass layout data to the server. This data is retrieved by using the ASPxClientSplitter.GetLayoutData method and passed as a parameter via the MVCxClientCallbackPanel.PerformCallback method to the server side to the corresponding Controller Action method. Then the client layout data is applied to Splitter in the SplitterSettings.ClientLayout  event handler. server event.See Also: E3960: How to save ASPxSplitter's client-side layout after every modification of the control by an end-user

@{
    ViewBag.Title = "MVC Splitter - How to save the client layout of the control after every modification by an end-user";
}

<h2>MVC Splitter - How to save the client layout of the control after every modification by an end-user</h2>
<script>
    var timerID = -1;
    function UpdateState(s, e) {
        if (timerID == -1) {
            timerID = setTimeout(
             function () {
                 CallbackPanel.PerformCallback({ layout: Splitter.GetLayoutData() });
                 timerID = -1;
             }, 0);
        }
    }
</script>
<a href="@Url.Action("Index","Home")" target="_blank">Open page in new window</a>
@Html.Action("CallbackPanelPartial")
See Also