Chaning the Dock's drag handle on client side

4 posts, 0 answers
  1. JQ
    JQ avatar
    13 posts
    Member since:
    Aug 2007

    Posted 29 Aug 2007 Link to this post

    I basically copied from the following demo,
    http://www.telerik.com/DEMOS/ASPNET/Prometheus/Dock/Examples/SetDragHandleClientSide/DefaultCS.aspx

    the part that changes the drag handle using javascript
    function changeRadDockHandle(dockID,handleID){  
        var dockObj = $find(dockID);  
        dockObj.set_handle(document.getElementById(handleID));  

    It seems that $find function does ,in fact, exist. However, unlike the demo, the returned object dockObj is NULL!

    Any clue why this happens?
  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 30 Aug 2007 Link to this post

    Hello JQ,

    The only idea that comes to my mind is that you are not providing the RadDock's ID correctly. Please, make sure that you are passing the RadDock's ClientID to the changeRadDockHandle function and that a dock with this ID exists on the page. If the problem persists, then a simple page demonstrating the problem would be of great help for us to quickly solve the issue.

    Regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. JQ
    JQ avatar
    13 posts
    Member since:
    Aug 2007

    Posted 30 Aug 2007 Link to this post

    Hi.
    The problem was that OnClientInitialize function should only have the name of the javascript function. That is, the function declaration should rather be
    function changeRadDockHandle(){     
        var dockObj = $find('dock');     
        dockObj.set_handle(document.getElementById('dock_C_newHandle'));     
    }    
     

    and in the code-behind,
    dock.OnClientInitialize = "changeRadDockHandle";//correct  
    dock.OnClientInitialize = "changeRadDockhandle(dock.ClientID,handle.ClientID)"; //wrong  
     

    Just in case this might save someone else's time...

  4. Adriano
    Adriano avatar
    16 posts
    Member since:
    Apr 2007

    Posted 04 Sep 2007 Link to this post


Back to Top