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

Client API collapse not working.

1 Answer 83 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Bram
Top achievements
Rank 1
Bram asked on 20 May 2008, 02:43 PM
I am using the RadSplitter inside another RadSplitter and the page is infested with Ajax updating stuff... so I thought the best way to do this "easy" task would be to include a javascript function.

    function openMessage(sender,args)
    {
            var splitter = <%=RadSplitterContent.ClientID %>;
           
            if(!splitter) return;
                    var pane = splitter.getPaneById('RadPane3');
                    if (!pane) return;
                    pane.collapse();
    }

The function is called by an onClientClick event of a button, no problem there.

This is the code I got from reading the forum here, as well as the example in the Live Demo section. I change the first line to include document.getElementById, because this way of working set splitter to null.

Anyway, when I finally get something that isn't null, the splitter.getPaneById method fails. Firebug says "splitter.getPaneById is not a function".

Anyone got this problem before?

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 21 May 2008, 04:14 PM
Hi Bram,

The client-side methods are methods of the client objects, not of the HTML elements. With the built-in function document.getElementById you obtain a reference to the HTML element instead of the client object and that is why you got the eror "splitter.getPaneById is not a function". 

The way you have tried to obtain a reference to the RadSplitter is the one, used when using RadControls for ASP.NET. When you use the ajax-based suite RadControls for ASP.NET AJAX you should obtain the reference with the $find method as shown below:

 
   var splitter = $find("<%=RadSplitterContent.ClientID %>");  
 

There are a lot of significant differences in the client-side API and the page-lifecycle between RadControls for ASP.NET and RadControls for ASP.NET AJAX because of the ajax framework specifics.

I recommend to examine the RadControls for ASP.NET AJAX documentation which can be found here.

Best wishes,
Svetlina
the Telerik team

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