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

set_collapsed() trouble

2 Answers 101 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 06 Oct 2008, 04:25 PM
Hi! I'm using RadDock to built portal, with dynamically created docks. Docks has templated title bars, without any RadDock's commands. My template in title bar has one button, with javascript onclick handler, that looks like this:

  alert(pDockID);
  var dock = $find(pDockID);
  alert(dock);
  alert(dock.get_collapsed());
  dock.set_collapsed(true);

pDockID - is known and correct client ID of dock.

Dock changes their collapsed property from false to true, but nothing happens on the screen (i.e. dock does not collapsing). Is there any reason to prevent collapsing?
Thanks!

2 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 06 Oct 2008, 04:57 PM
And one more question (little offtopic). When dock is dragged over zone, docks in this zone rolled out, to free a space for dragged dock. Is there any way to set style for this region in zone?
  Image explanation

Thanks!
0
Petko
Telerik team
answered on 08 Oct 2008, 10:20 AM
Hello Alex,

We are aware of this problem with RadDock and we are currently working on fixing it. It appeared after introducing resizable functionality of RadDock. For the time being we can provide the following workaround: 

  1. First in the code-behind, where you dynamically create RadDocks, you should add this client handler:

 

                                           dock.OnClientInitialize = "DockLoad"; 

    2. Second you should set the ID of the button in the title template like this:

                                          myButton.ID = dock.ClientID + "_MyButton";

so you can find it in the client-side.

At last, in your javascript code you should add the following function:

   function DockLoad(obj,args)  
        {                                                  
            var mybutton;                     
            for(var i=0; i < obj._titleBar.childNodes.length; i++)  
            {                                           
                if(typeof(obj._titleBar.childNodes[i].id) != "undefined" && obj._titleBar.childNodes[i].id.match("_MyButton") != null)  
                {                                       
                    mybutton = $get(obj._titleBar.childNodes[i].id);                      
                    break;  
                }  
            }                   
            if(mybutton)  
            {  
                $addHandler(mybutton, "mousedown", function(e)  
                {  
                e.stopPropagation();  
                });  
            }  
        }  

With this additional modification you can use your javascript onclick handler to achieve your purpose.

Regarding your other question about changing the style of a region in RadDockZone, you can use the CSS class .rdPlaceHolder .E.g.:

 

.rdPlaceHolder   
{  
    border: solid 1px red !important;  

 

 

Let us know if you need further assistance.


All the best,

Petko
the Telerik team

 

 


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
Petko
Telerik team
Share this question
or