RadSplitter and RadPane not displaying all content

1 Answer 116 Views
Splitter
James
Top achievements
Rank 1
James asked on 23 Aug 2021, 04:06 PM

Hi,

I have been struggling with this issue for some time.  Here is the problem.  When the page is first loaded, the splitter is displaying half of the content as in step1.jpg.  However when I resize the browser width or height just tiny bit, the splitter is displaying the entire content occupying the entire page as in step2.jpg.

<telerik:RadSplitter runat="server" ID="Splitter" Width="100%" OnClientLoaded="SplitterLoaded" Height="95%">
    <telerik:RadPane runat="server" ID="LeftPane" Scrolling="Both">
        <!-- left pane is loaded dynamically -->
    </telerik:RadPane>
    <telerik:RadSplitBar runat="server" ID="SplitBar" CollapseMode="Both" />
    <telerik:RadPane runat="server" ID="RightPane">
        <!-- right pane is loaded dynamically -->
    </telerik:RadPane>
</telerik:RadSplitter>

The content in the splitter is loaded dynamically using "knockout" js library.  Is there a way to resize the splitter to display the entire content as in step2.jpg when the page is loaded?

Please let me know if you need more information.  I really appreciate any help from you.

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 24 Aug 2021, 05:26 PM

Hello James,

I have just answered your support ticket on the matter, for convenience I will copy my reply here as well:

 

The faced behavior is related to the fact that the Splitter is rendering itself inside-out and in scenarios like your it needs to be repainted once it is shown/loaded. Can you try calling the control's repaint() when the control is populated with data (or shown) and let me know the result?

$find("Splitter").repaint();

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

James
Top achievements
Rank 1
commented on 27 Aug 2021, 09:03 PM

Thanks for the reply. 

I assume that

$find("Splitter").repaint();

is a javascript call but when I call it from javascript script file, there is an error "Uncaught TypeError: Cannot read property 'repaint' of null".  "Splitter" is a server side id and the javascript does not know its existence.  What is the proper way of calling this?

Vessy
Telerik team
commented on 31 Aug 2021, 03:03 PM

You need to keep on the page only the code that uses the server tags. For example, if you keep the ID of the control as a global variable, you can just declare it in the .aspx and use the global id variable inside the external script:

ASPX:

<script>
    window.myGloballyAccessedVariable =  "<%= txtRaise_Base.ClientID %>";
</script>

External JS file:

function myfunction() {
    var textbox = $find(window.myGloballyAccessedVariable);
}

Another option is to use pure DOM traversal and access the .control property of the elements. For more examples and ways to access client-side object references, check out this article:

Keep in mind that you can use the Telerik Static Library as well to facilitate finding the objects, e.g. use $telerik.findControl(parentElement, serverID):

Tags
Splitter
Asked by
James
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or