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

PickerButton inside a RadDock

1 Answer 55 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
SeRiAlKiL
Top achievements
Rank 1
SeRiAlKiL asked on 11 Sep 2008, 07:32 AM
Hello,

I have placed a pickerbutton inside a raddock, but when i click the button, the palette appear inside the dock causing it to show scrollbars (the dock is 200x200 px)

Is there a way to show the palette outside the dock?

Thank for the attention

Francesco

1 Answer, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 15 Sep 2008, 08:03 AM
Hi,

The rules of CSS/HTML maintain that a child element cannot visually "break out" of its parent element.
The behavior you mention could be observed in the other Telerik controls which use the pop up behavior as well -RadToolTip, for example. The problem is a result of the popup element of these controls being rendered where the control itself is rendered which is needed in scenarios in which there are ajax updates. However, this leads to the behavior you observe and it could be resolved if the popup element is added to the form element instead of where it is declared. As we have received other requests for such a behavior from our customers, we think to add a property to these controls which could be used to specify where the popup element of the control to be rendered. For the time being, the solution here would be to "trick" the colorpicker to be added to the root of the body rather than to where it is declared.
Please add the following code to the page with the colorpicker(it overrides a colorpicker method) and give it a try:
<script type="text/javascript">  
TelerikTelerik.Web.UI.RadColorPicker.prototype._oldCreatePalette = Telerik.Web.UI.RadColorPicker.prototype._createPalette;  
Telerik.Web.UI.RadColorPicker.prototype._createPalette = function()  
{  
    this._oldCreatePalette();  
    var div = document.createElement('div');   
    div.className = "radcolorpicker RadColorPicker_Default";  
    div.appendChild(this._paletteWrapperElement);  
    var form = document.forms[0];                
    form.appendChild(div);      
}  
</script> 
Please, note that if you use a different skin from the Default one you will need to change the Default word to the name of the skin you use in the className of the div element above.
Let us know if you need further assistance.

Best wishes,
Sophy
the Telerik team

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