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

How to access the "Text" property of the RadDock ClientSide

1 Answer 102 Views
Dock
This is a migrated thread and some comments may be shown as answers.
hkdave95
Top achievements
Rank 2
hkdave95 asked on 09 Jul 2008, 08:34 PM
Hi

I need to access the "Text" property of serverside RadDock ClientSide.

How do I do this ?

dock.get_element().value

or

dock.get_contentContainer().value ?

Kind Regards

David

1 Answer, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 10 Jul 2008, 08:38 AM
Hi David,

You can find the DOM element for the content region of the dock with the get_contentContainer method of the RadDock. The text which you set in the Text property of the RadDock is placed in the content container of the control inside a span element (if the corresponding dock does not have any other content, otherwise the set text is ignored). You will need to find this span element with javascript and take its value, e.g.:

<telerik:raddock id="dock1" runat="server" text="RadDock1"></telerik:raddock> 
<asp:button id="button" runat="server" text="Click me" onclientclick="alertText();return false;" /> 
<script type="text/javascript">  
function alertText()  
{  
    var dock = $find("<%= dock1.ClientID%>");  
    var content = dock.get_contentContainer();  
    var text = $telerik.isIE ? content.childNodes[0].innerHTML : content.childNodes[1].innerHTML;   
    alert(text);  
}  
</script> 

Let us know if you need further assistance.

Sincerely yours,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
hkdave95
Top achievements
Rank 2
Answers by
Sophy
Telerik team
Share this question
or