Inconsistencies with client-side API

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 27 May 2009 Link to this post

    I'm trying to understand someone else's code, and what I'm seeing it do doesn't seem consistent, or with Telerik's documentation.

    There is a RadSplitter:
    <telerik:RadSplitter ID="RadSplitter1" runat="server" LiveResize="true"  
    OnClientLoaded="OnClientLoadedHandler" VisibleDuringInit="false">

    It connects the OnClientLoaded event to the OnClientLoadedHandler javascript function.  This function is passed a reference to the splitter object.  This function sets the width of the splitter object by calling set_width() - which I can't see in the API documentation.
    function OnClientLoadedHandler(splitter, args) 
        // ... 
    The API documentation mentions a SetWidth() method, not a set_width() method, which makes me uncertain that I understand what is going on.  When I replace splitter.set_width() with splitter.setWidth(), I get an "Object doesn't support this property or method" error.

    More confusing yet, when I try to access the RadSplitter's client-side object from javascript outside the OnClientLoadedHandler() event function, as described in the documentation I linked, I get another object entirely:
    var splitter = <%=RadSplitter1.ClientID %>; 
    Looking at it in the Visual Studio 2008 debugger, the splitter object I get has entirely different methods and attributes than than did the splitter object that was passed to OnClientLoadedHandler().  The splitter object passed to the handler function has an empty id attribute and a _clientStateFieldID attribute equal to "ctl00_MasterContentPlaceHolder_RadSplitter1_ClientState".  The splitter object returned by <%=RadSplitter1.ClientID %> has an id of "ctl00_MasterContentPlaceHolder_RadSplitter1", and doesn't have a _clientStateFieldID attribute at all.  It doesn't have SetWidth(), setWidth(), or set_width() methods, either.

    Color me confused.
  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 28 May 2009 Link to this post

    Hello Jeff,

    We used to offer another suite of RadControls which was not ajax based - it was called RadControls for ASP.NET whereas the product which we currently offer is based on the MS AJAX Framework and it is called RadControls for ASP.NET AJAX. Both the suites have most of the controls (some of the controls exist only in the ajax based suite) and they differ in their client-side API. As far as I understand from your post, you are confused because the project you are working on is implemented (or migrated) to RadControls for ASP.NET AJAX and you are reading the documentation for RadControls for ASP.NET.

    This being said, the documentation you need is the following one:

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top