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

Rad Dock

1 Answer 73 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Nithya Rani
Top achievements
Rank 1
Nithya Rani asked on 20 Feb 2012, 06:48 AM
Hi

I have 2 raddock in my page. If i click collapse one should close and another should open. During that time my master page height is not changing. Code below is written to collapse the raddock.

 <script type="text/javascript">
        var allDocks = [];
        function DockInit(dock, args) {
            allDocks[allDocks.length] = dock;
        }
        function DockCommand(dock, args) {
            var commandName = args.command.get_name();
            if (commandName = "ExpandCollapse") {
                if (dock.get_collapsed() == false) {
                    for (var i = 0; i < allDocks.length; i++) {
                        if (allDocks[i] != dock) {
                            allDocks[i].set_collapsed(true);
                        }

                    }
                }
            }
        }
    </script>

See the attached image how its looks

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 22 Feb 2012, 04:23 PM
Hello Nithya,

The code that you have provided appears to be correct, except the operator in the first if statement. Please change it as shown below:
...
if (commandName == "ExpandCollapse") {
...

Also, you can set small value for the MinHeight property of the RadDockZone, in which the dock controls are placed, so that its height is defined by the contained RadDocks. This way your page's layout will be changed when the RadDocks are collapsed and expanded, if it depends on the height of the RadDockZone control.

Please provide additional information on your problem, if there are still details left unclear.

Kind regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Dock
Asked by
Nithya Rani
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or