capture dockid from custom commands

10 posts, 0 answers
  1. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 14 Jul 2007 Link to this post

    I thought I posted this in Prometheus but relized I didn't so I am posting it here as well

    how do you capture it from custom commands? I have tried your demo and still can't ficure it out.  on your demo you call function CustomCommand(radDock, args).  I have tried raddoc.getid() didn't work.  I have tried raddock.id, and doesn't work.  please help

    thank you
  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 16 Jul 2007 Link to this post

    Hello,

    Your confusion was caused by a minor mistake in our example - the parameter in the function is not the dock object, but the command object. Here is how you can get the id of the dock:

            function CustomCommand(dockCommand, args)
            {
               alert(dockCommand.get_RadDock().get_id());
            }

    Our online example will be changed as soon as possible.

    Best wishes,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 16 Jul 2007 Link to this post

    in dock state you have the following variables.
    {"UniqueName":"46"
    ,"Width":"150px"
    ,"Height":"150px"
    ,"Top":"369px"
    ,"Left":"257px"
    ,"Closed":"False"
    ,"Collapsed":"False"
    ,"Pinned":"False"
    ,"Title":"RSS Reader"
    ,"Text":""
    ,"Tag":"51"
    ,"Index":"0"
    ,"DockZoneID":"ZoneLeft"}

    is there any way that I can access them in client side javascript?
    or is there a replacement for (SetSize)?
    thanks
  5. Petya
    Admin
    Petya avatar
    869 posts

    Posted 17 Jul 2007 Link to this post

    Hello,

    If you simply want to set new values for width/height of a RadDock, then I would suggest the following approach:

      <telerik:raddocklayout id="RadDockLayout1" runat="server" skin="Default">
                <telerik:raddockzone id="RadDockZone1" runat="server"  orientation="Horizontal"
                    width="700px">
                    <telerik:raddock id="RadDock3" runat="server" dockmode="Docked" height="280px" title="Dock3"
                        width="200px">
                    </telerik:raddock>
                </telerik:raddockzone>
                <telerik:raddockzone backcolor="Red" id="RadDockZone2" runat="server" minheight="300px"
                    width="700px">
                </telerik:raddockzone>
               
            </telerik:raddocklayout>

            <input id="Button2" onclick="SetSize()" type="button" value="Set Size" />

    <script type="text/javascript">
        function SetSize()
        {
            var dock = $find('<%= RadDock3.ClientID%>');
            dock.set_Size(500, 100);
        }
       
        Telerik.Web.UI.RadDock.prototype.set_Size = function(width, height)
        {
            this.get_element().style.width = width;
            this.set_Width(width);
            this._setCommandsContainerWidth();
           
            this.get_element().style.height = height;
            this.set_Height(height);
            this._setContentContainerHeight(true);
           
            this.updateClientState();
        }
        </script>


    With this approach the new size will not persist through postbacks. Currently, this feature has been logged in our system and you cannot workaround it.

    Sincerely yours,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 17 Jul 2007 Link to this post

    i am not having any problems changing the size on the client side.  The problem is the new settings are not showing up when I use 

    GetRegisteredDocksState on the server side to get the new height and width.  How do I get them to show up on the post back?


    Thanks

  7. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 17 Jul 2007 Link to this post

    i am not having any problems changing the size on the client side.  The problem is the new settings are not showing up when I use 

    GetRegisteredDocksState on the server side to get the new height and width.  How do I get them to show up on the post back?


    Thanks

  8. Petya
    Admin
    Petya avatar
    869 posts

    Posted 17 Jul 2007 Link to this post

    Hello rebtech,

    1. If you set width/height client-side then you won't be able to get these values on the server because this functionality has not been implemented yet.

    2. If you set width/height server-side then you should be able to get these values with GetRegisteredDocksState. If however you do not get them, then please send us sample running code that reproduces the issue and we will take a look at it to examine the origin of the issue.

    Looking forward to your reply.

    Regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 17 Jul 2007 Link to this post

    and there's no way to edit these variables?  and if there is not access to all of them what about the tag variable?

    thanks

    {"UniqueName":"46"
    ,"Width":"150px"
    ,"Height":"150px"
    ,"Top":"369px"
    ,"Left":"257px"
    ,"Closed":"False"
    ,"Collapsed":"False"
    ,"Pinned":"False"
    ,"Title":"RSS Reader"
    ,"Text":""
    ,"Tag":"51"
    ,"Index":"0"
    ,"DockZoneID":"ZoneLeft"}
  10. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 17 Jul 2007 Link to this post

    if that can't be done I built a work around using a custom command and hidden feilds that are assoiciated with the dock objects.

    http://www.saidcom.net/RAD/Default.aspx
  11. Petya
    Admin
    Petya avatar
    869 posts

    Posted 18 Jul 2007 Link to this post

    Hello rebtech,

    The properties you mention are supposed to be accessed/modified on the server. About your last post - I am glad you found a solution to your issue. If you still experience any problems, please write us again with a detailed explanation about what you are trying to achieve and what are the problems that you encounter.

    Sincerely yours,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017