Dock Command Position

3 posts, 0 answers
  1. Mark Davison
    Mark Davison avatar
    82 posts
    Member since:
    Jul 2005

    Posted 22 Jun 2007 Link to this post

    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. Petya
    Admin
    Petya avatar
    869 posts

    Posted 22 Jun 2007 Link to this post

    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
  3. Mark Davison
    Mark Davison avatar
    82 posts
    Member since:
    Jul 2005

    Posted 22 Jun 2007 Link to this post

    Hi Petya,

    Your solution worked perfectly!

    Many thanks for your help.

    Regards,

    Mark
Back to Top