This is a migrated thread and some comments may be shown as answers.

Hide splitter while formatting layout

4 Answers 142 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Daron
Top achievements
Rank 1
Daron asked on 19 Feb 2008, 06:02 PM
Does anyone know how to hide the page content while the splitter is sorting itself out? The 2 splitters I have (one vertical, one horizontal) start out in weird positions on the screen before coming to their final resting positions. My client would like to hide the screen until a "neat" screen is able to be displayed.

I have tried using the splitter's OnClientLoaded and javascript's pageLoad events but with little success.

Any help appreciated.

Cheers

4 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 22 Feb 2008, 01:05 PM
Hi Daron,

Basically this problem can be handled by setting the RadSplitter's VisibleDuringInit property to "false".
However, we recently found a problem with this property when used with nested RadSplitters. The problem that I refer to is the following - the nested RadSplitter initializes first and becomes visible. After that, the parent RadSplitter calculates its size (at this point it is not visible) and resizes its child splitter (at this point it is visible). We have prepared a workaround that you can use for the time being until we are able to fix the problem. Please have a look at the code bellow that demonstrates the idea:

<body>       
    <form id="form1" runat="server">        
        <telerik:RadSplitter ID="RadSplitter1" runat="server" OnClientLoaded="MainSplitterLoaded" Height="100%" Width="100%">        
               ......................     
                <telerik:RadSplitter ID="RadSplitter2" runat="server">     
                .....     
                </telerik:RadSplitter>        
        </telerik:RadSplitter>       
    </form>       
    <script type="text/javascript">            
    var mainSplitterElement = $get('RAD_SPLITTER_<%= RadSplitter1.ClientID %>');        
    mainSplitterElement.style.visibility = "hidden";        
            
    var nestedSplitterElement = $get('RAD_SPLITTER_<%= RadSplitter2.ClientID %>');        
    nestedSplitterElement.style.visibility = "hidden";        
            
    function MainSplitterLoaded()        
    {        
        mainSplitterElement.style.visibility = "visible";        
        nestedSplitterElement.style.visibility = "visible";        
    }        
    </script>       
</body>       
 

Note that I have removed VisibleDuringInit=true for the RadSplitter controls. I hide the splitters manually, until the main splitter has finished loading.

Let us know how it goes.

All the best,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Daron
Top achievements
Rank 1
answered on 27 Feb 2008, 12:15 PM

Hi Svetlina,
Thanks for your response.

This solution seems to work ok. It's not 100% but better than it was before.
Please note that I had to write a 'hide' and 'show' style for each splitter on my form.

Looking forward to a fix for the VisibleDuringInit bug.

Cheers,
Daron

0
jtby
Top achievements
Rank 1
answered on 17 Apr 2008, 05:07 PM

the solution almost works - except that when the page first loads the splitter layout appears on the screen - then goes hidden after the suggested javascript, then appears again when everything is ready.  How do you get a splitter to start out hidden?  For exmaple:

<telerik:RadSplitter ID="RadOuter" Height="100%" Width="100%" OnClientLoaded="ScreenLoaded"style="visibility:hidden" runat="server" Orientation="Horizontal" Skin="Black" >

... this does not make the splitter hidden when the page is first loaded as I would expect.  So it starts out visible when page first starts loading, then goes blank when I hide it via javascript, then appears again aftery everything is all set.

0
Tsvetie
Telerik team
answered on 18 Apr 2008, 07:10 AM
Hello jtby,
The VisibleDuringInit property now works as expected. In case you download the version of RadControls for ASP.NET AJAX that we released earlier this week, version number 2008.1.415.20, you can just set VisibleDuringInit to false for all splitters, and need not implement the workaround.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Splitter
Asked by
Daron
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Daron
Top achievements
Rank 1
jtby
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or