JS error, Can not user DockZone.dock()

2 posts, 0 answers
  1. Elton
    Elton avatar
    98 posts
    Member since:
    Oct 2007

    Posted 11 Oct 2007 Link to this post

    Hello there,
    I try to use dock() to set the position of a dock :
    my code:

        var dockZone = $get("RadDockZone1");

    //var dockZone = document.getElementById("RadDockZone1");

    var dock = $get("RadDock3");

    //var dock = document.getElementById("RadDock3");

    dockZone.dock(dock, 0);

    and I got javascript error:Object doensn't support this property....

    Pls help,

  2. Petya
    Petya avatar
    869 posts

    Posted 12 Oct 2007 Link to this post

    Hello Elton,

    The problem you experience comes from the fact that you have used $get whereas you should use $find. The difference is that $get returns the DOM element while $find returns the JavaScript object. In your case you need the JavaScript object to use its methods so your function should look like this:

    var dockZone = $find("RadDockZone1");

    var dock = $find("RadDock3");

    dockZone.dock(dock, 0);

    To make it more clear for example $find("RadDock3"); returns a JS object while $get("RadDock3") returns a DIV element. You may refer to our Client-side API online demo for more examples. More information about $get and $find you can read here. Hope we have been helpful.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top