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

Chaning the Dock's drag handle on client side

3 Answers 92 Views
Dock
This is a migrated thread and some comments may be shown as answers.
JQ
Top achievements
Rank 1
JQ asked on 29 Aug 2007, 07:36 PM
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?

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 30 Aug 2007, 06:37 AM
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
0
JQ
Top achievements
Rank 1
answered on 30 Aug 2007, 02:45 PM
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...

0
Adriano
Top achievements
Rank 1
answered on 04 Sep 2007, 06:42 PM

Tags
Dock
Asked by
JQ
Top achievements
Rank 1
Answers by
Petya
Telerik team
JQ
Top achievements
Rank 1
Adriano
Top achievements
Rank 1
Share this question
or