in old window version i used GetTitleBar to add one more button to window title (help button). But now this method is gone. Is it still any way to add custom button to title bar?
Thanks
Alex
8 Answers, 1 is accepted
In your particular scenario the method GetTitlebar() exists but due to the changed rendering in the control, its return value is different. You can easily check what element is returned if you just alert the outerHTML in this way:
alert(oWnd.GetTitlebar().outerHTML);
If you experience difficulties we encourage you to send us the exact scenario you want to achieve (in classic version of the control) and we will rework it for you with the Prometheus version.
Please mind that in the new "Prometheus" suite we have changed the API methods case to the MS AJAX framework case. You can find a reference of the new properties in the RadWindow Methods online article.
Best wishes,
George
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Hi George,
well, i have not succeed, perhaps you can help. this code worked with radwindow, now it adds new icon, but on the wrong place. Would be great if you can fix it. The idea was to add one more icon to all windows and open help windows on click
function OnClientShow(radWindow){
if (radWindow.get_id() !="wnd1_wndHelp")
{if (!oHelpButton[radWindow.get_id()])
{
oHelpButton[radWindow.get_id()]=true;
var TitleBar = radWindow.GetTitlebar();
var parent = TitleBar.parentNode; //.parentNode;
var close2 = document.createElement("<img class='RadWButton' style='vertical-align:middle;border:0' src='HelpImages/help.gif'/>");
close2.onclick = function()
{
var oArg = radWindow.Argument;
var oWnd = oArg.MyOpenWindow("HelpFiles.aspx?HelpID=" + radWindow.get_id() + "&WindowQS=" + radWindow.GetContentFrame().contentWindow.location.search , "wndHelp");
}
var oCell = parent.insertCell(-1);
oCell.appendChild(close2);
}
}
}
I have enclosed the required functionality in a sample project. Please give it a try and in case of some more difficulties do not hesitate to ask.
Greetings,
George
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
thanks, it works almost fine. The only thing is when you click on a new button - pin button also get clicked. Try to comment out alert in CallBackFunction - and you will see. Perhaps you can easy fix this
Thanks
Alex
Thanks for the remark, that is because the real event that should be overridden is onclick.
Kind regards,
George
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
unfortunately - this does not help, I also tried mouse up/down, click event - pin still changing (also at your latest sample).
Alex
On our side the pin is changing under IE only, it seems that the event is not properly overriden there. At this point we can only suggest you to remove the pin button in the way of the attached sample. Please mind that this is a hack over the window and may not behave well in some particular scenarios.
We have considered better logic for manipulating the titlebar for some of the future releases.
All the best,
George
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
it hides pin button, but still pin button code is running :-))
ok, seems i found solution, instead of cloning I am creating node, looks ok so far:
var newLI = document.createElement("LI");
newLI.innerHTML="<A class=custombutton title=\"Помощь\" href=\"javascript:void(0);\"><SPAN>Помощь</SPAN></A>"
var newA = newLI.getElementsByTagName('a');
Alex