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

Dock Command Position

2 Answers 84 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Mark Davison
Top achievements
Rank 1
Mark Davison asked on 22 Jun 2007, 11:29 AM
Hi,

Is it possible to get a dock command position in JS on the client? When the user clicks one of the "command" buttons, I need to display a div just under the dock command button - I am dynamically creating a menu of options and I need to position this.

Regards,

Mark

2 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 22 Jun 2007, 11:42 AM
Hello Mark Davison,

Here is a possible way you can achieve this:

<telerik:raddock id="RadDock3" runat="server" dockmode="Docked" height="280px" title="Dock3" width="200px">
        <commands>
               <telerik:dockcommand name="edit" onclientcommand="EditCommand" />
         </commands>
</telerik:raddock>

........

<script type="text/javascript">

function EditCommand(command, args)
    {
        var commandElement = command.get_element();
       
        var loc = $telerikCommon.getLocationWithScrollOffset(commandElement);
       
        alert(loc.x);
        alert(loc.y);
    }
 </script>

Let me know if this helps.

All the best,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark Davison
Top achievements
Rank 1
answered on 22 Jun 2007, 12:35 PM
Hi Petya,

Your solution worked perfectly!

Many thanks for your help.

Regards,

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