We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Some problems in resizing the splitter

Hi,

see the attached registration where I've explained my problem and question.

Using the splitter I'm not able ro resize the panes automatically to the right of the page and to the bottom of the page so that all the page is completely filled by the panes.

The page is this:


@{Html.EJ().Splitter("outer").Height("600").Width("100%").Orientation(Orientation.Horizontal).EnableAutoResize(true).PaneProperties(
  p =>
  {
      p.Add().ContentTemplate(

@<div class="splitdiv" style="height: 100%">

    @innerSplitter()

</div>);

p.Add().ContentTemplate(
@<div class="splitdiv">
    Pane 3
</div>).PaneSize("80%");
}).Render();}


@helper innerSplitter()
{
    @Html.EJ().Splitter("inner").EnableAutoResize(true).PaneProperties(p1 =>
        {
            p1.Add().ContentTemplate(
                    @<div class="splitdiv">
                        Pane 1
                    </div>).PaneSize("50%");
                         p1.Add().ContentTemplate(
                            @<div class="splitdiv">
                                Pane 2
                            </div>).PaneSize("50%");
                             }).Orientation(Orientation.Vertical)
}


I'm using Syncfusion Themes with this JS code:

   function setStyle(stile) {
            if (stile && stile.startsWith("STILE: ")) {
                var aus = stile.substr(7);
                var link = window.document.getElementsByTagName('link'); //get the link of css file
                var value = aus;
                $(link).attr('rel='nofollow' href', "/Content/ej/web/" + value + "/ej.web.all.min.css") // Change the theme
            }
        }

this function is called in  $(document).ready to set a configured theme selected by the user from a menu (all themes starts in the menu with "STILE: "), and remembered (using cookies) when the page is reloaded.

As you can see in my registration, when the page is loaded "Pane 3" does not resize till the rigth size of the screen.

Beside, I don't know how to automatically resize the whole Pane group till the bottom of the page. If I change Height("600")  with Height("100%")     I don't obtain what I want.
Can you help me?
Thank you.


Attachment: question_to_syncfusion_for_splitter_control_84d89736.zip

2 Replies

SI Silvio May 1, 2019 06:03 AM UTC

Sorry I'm using EJ1.


AB Ashokkumar Balasubramanian Syncfusion Team May 2, 2019 08:54 AM UTC

Hi Silvio,  
 
Thank you for contacting Syncfusion support.  
 
Out Splitter component will take the height and width based on its parent element. So to set 100% height and width for splitter, its parent must have 100% height and width. We suggest you set height and width styles for parent container as shown in the below code.  
 
<div style="margin:0;padding:0;height:100%;width:100%;"> 
    @{Html.EJ().Splitter("outer").Height("680")Width("100%").Orientation(Orientation.Horizontal).EnableAutoResize(true).PaneProperties( 
         p => 
         { 
             p.Add().ContentTemplate( 
 
@<div class="splitdiv"> 
 
    @innerSplitter() 
 
</div>); 
 
     p.Add().ContentTemplate( 
@<div class="splitdiv"> 
    Pane 3 
</div>).PaneSize("80%"); 
}).Render();} 
 
 
    @helper innerSplitter() 
    { 
        /**/ 
        @Html.EJ().Splitter("inner").EnableAutoResize(true).PaneProperties(p1 => 
            { 
                p1.Add().ContentTemplate( 
                                    @<div class="splitdiv"> 
                                        Pane 1 
                                    </div>).PaneSize("50%"); 
                             p1.Add().ContentTemplate( 
@<div class="splitdiv"> 
    Pane 2 
</div>).PaneSize("50%"); 
                     }).Orientation(Orientation.Vertical) 
    } 
</div> 
<style type="text/css" class="cssStyles"> 
 
    #inner { 
        border: 0 none; 
    } 
 
    #outterSpliter { 
        margin: 0 auto; 
    } 
 
    .splitdiv { 
        height: 100%; 
        width: 100%; 
    } 
</style> 
 
We have prepared a sample for your reference which can be downloaded from the below link 
 
 
While setting 100% height for Splitter, control will be rendered based on the body element height. To render the splitter with height of entire page, we suggest you specify the corresponding value to height property as done in our sample. It seems “Pane 3” is not rendered correctly in the shared video during page refresh. Unfortunately, we were unable to replicate this issue in our end. We suggest you to invoke the refresh() method of splitter through splitter instance as shown below during create event of Splitter or any other functions which will be executed during page refresh.  
 
function create(args){  
     var obj = $("#splitter").data("ejSplitter");  
    obj.refresh();  
} 
 
If you wish to change the pane size dynamically, kindly refer to the below UG link 
 
 
Please let us know, if you have any concern on this. 
 
Regards, 
Ashokkumar B.  


Loader.
Live Chat Icon For mobile
Up arrow icon