4 Answers, 1 is accepted
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Mar 2012, 05:38 AM
Hello Robert,
Try the following javascript on hooking OnClientShow event of the RadWindow.
JS:
Thanks,
Princy.
Try the following javascript on hooking OnClientShow event of the RadWindow.
JS:
<script type="text/javascript">function OnClientShow(radWindow) { var TitleBar = radWindow.GetTitlebar(); var parent = TitleBar.parentNode; var oUL = parent.getElementsByTagName('UL')[0]; if (!(oUL.firstChild.id == "customprintbuttonID")) { oUL.style.width = "192px"; var oLI = document.createElement("LI"); oLI.id = "customprintbuttonID" var A = document.createElement("A"); oLI.appendChild(A); A.className = "customprintbutton"; A.href = "javascript:void(0)"; A.title = "Print Content"; oUL.insertBefore(oLI, oUL.firstChild); radWindow._updateTitleWidth(); }}Thanks,
Princy.
0
Robert
Top achievements
Rank 1
answered on 19 Mar 2012, 01:41 PM
Thank you for the response, and the code to place the button on the Title Bar works great;
An additional question -
Is it possible to place a customized button, which reads "Return to Menu" as an example;
I am hoping to utilize this button to close the RadWindow - I already have the necessary JavaScript;
Thanks in advance for any insight;
An additional question -
Is it possible to place a customized button, which reads "Return to Menu" as an example;
I am hoping to utilize this button to close the RadWindow - I already have the necessary JavaScript;
Thanks in advance for any insight;
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Mar 2012, 10:22 AM
Hello Robert,
Try the following JavaScript to close the RadWindow on Clicking the Button.
JS:
Thanks,
Princy.
Try the following JavaScript to close the RadWindow on Clicking the Button.
JS:
<script type="text/javascript"> function OnClientShow(radWindow) { var TitleBar = radWindow.GetTitlebar(); var parent = TitleBar.parentNode; var oUL = parent.getElementsByTagName('UL')[0]; if (!(oUL.firstChild.id == "customprintbuttonID")) { oUL.style.width = "192px"; var oLI = document.createElement("LI"); oLI.id = "customprintbuttonID" var A = document.createElement("A"); oLI.appendChild(A); A.className = "customprintbutton"; A.href = "javascript:void(0)"; A.title = "Close"; A.onmousedown = closewindow; oUL.insertBefore(oLI, oUL.firstChild); radWindow._updateTitleWidth(); } } function closewindow(e) { var oManager = GetRadWindowManager(); var oWnd = oManager.GetWindowByName("RadWindow1"); oWnd.Close(); return $telerik.cancelRawEvent(e); }</script>Thanks,
Princy.
0
Accepted
rdmptn
Top achievements
Rank 1
answered on 20 Mar 2012, 12:11 PM
I believe you'd rather want to change the title property of the custom button to the desired string in the above snippet. Or you could just use the built-in Close button (with the [x]) and change its tooltip to the desired string via the localization options the RadWindow provides (http://www.telerik.com/help/aspnet-ajax/radwindow-localization.html).