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

This works, but is it optimal?

1 Answer 36 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 15 Jan 2013, 02:43 PM
As usual I'm on a deadline and tinkering with aspects of Telerik I don't fully understand.  
I've been looking at your splitter demo (http://demos.telerik.com/aspnet-ajax/splitter/examples/clientsideapi/defaultcs.aspx)

I have a form with regions divided up by splitters.  

Like your demo I need to be able to expand and collapse the end pane in Javascript, depending on the value set in a combobox.  

Unlike your demo, the page is supposed to start off with the endpane collapsed.  The toggle in my checkForValue function when the pane is initially collapsed,  initially didn't work.  

To fix this, on the server side, in the Page_Load event, to initially expand the pane, I put:
 RadPaneEnd.Width = new System.Web.UI.WebControls.Unit("55%");

On the client side, I put this, to fire on load, and collapse the pane:
  $(document).ready(function () {        
            var splitter = $find("<%=RadSplitter1.ClientID%>");
            var endPane = splitter.getEndPane();
            endPane.collapse(Telerik.Web.UI.SplitterDirection.Backward);
        })

The expand/collapse function itself is:
  function checkForValue(sender, args) {
     var splitter = $find("<%=RadSplitter1.ClientID%>");
     var endPane = splitter.getEndPane();
     var curVal = sender.get_text();
     if (curVal == 'Value1') {
         endPane.expand(Telerik.Web.UI.SplitterDirection.Backward);
     }
     else {
        endPane.collapse(Telerik.Web.UI.SplitterDirection.Backward);
     }           
  }


1 Answer, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 18 Jan 2013, 11:45 AM
Hi Boris,

I tried to reproduce the described scenario and everything behaves well on my side. The provided functions seem to be configured correctly.

For your convenience I am attaching my test project - I attached the checkForValue() function as a handler to the RadCombobox's OnClientSelectedIndexChanged event.

I hope this was helpful for you. Feel free to contact us if we could be of any further assistance.

Kind regards,
Vesi
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Splitter
Asked by
Boris
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or