Iterate through each RadDock in a RadDockZone in Javascript

3 posts, 1 answers
  1. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 30 Dec 2010 Link to this post

    I have 4 RadDocks ("RadDock1", "RadDock2", etc.) inside of RadDockZone1.  In the OnClientDockPositionChanged() function in Javascript, I would like to iterate through each RadDock in RadDockZone1.  How can I do this using a foreach loop, or another method?
  2. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 03 Jan 2011 Link to this post

    Hi Richard,

    To get reference to all the docks in a specific DockZone you can use the get_docks() method of the dock zone, e.g.:
    function OnClientDockPositionChanged(dock, args)
    {
        var dockZoneId = dock.get_dockZoneID();
        var dockZone = $find("" + dockZoneId);
     
        if (dockZone)
        {
            var docks = dockZone.get_docks();
            for (var i = 0; i < docks.length; i++)
            {
                alert(docks[i].get_id());
            }
        }
    }

    You can find more information about the RadDockZone client-size object in the following help article:
    RadDockZone Client Object

    Greetings,
    Dobromir
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 03 Jan 2011 Link to this post

    That works.  Thank you very much!
Back to Top