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

JS error, Can not user DockZone.dock()

1 Answer 38 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Elton
Top achievements
Rank 1
Elton asked on 12 Oct 2007, 02:37 AM
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,
Cheers,
Elton 

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 12 Oct 2007, 07:52 AM
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.

Regards,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
Elton
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or