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

[Solved] Add one more button to title

8 Answers 141 Views
Window
This is a migrated thread and some comments may be shown as answers.
Alex Dybenko
Top achievements
Rank 2
Alex Dybenko asked on 27 Feb 2008, 04:53 PM
Hi,
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

Sort by
0
George
Telerik team
answered on 27 Feb 2008, 05:46 PM
Hi Alex Dybenko,

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
0
Alex Dybenko
Top achievements
Rank 2
answered on 03 Mar 2008, 09:54 AM

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);
}
}

}

0
George
Telerik team
answered on 04 Mar 2008, 12:28 PM
Hi Alex Dybenko,

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
0
Alex Dybenko
Top achievements
Rank 2
answered on 07 Mar 2008, 11:07 AM
Hi George,
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
0
George
Telerik team
answered on 07 Mar 2008, 02:44 PM
Hi Alex Dybenko,

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
0
Alex Dybenko
Top achievements
Rank 2
answered on 11 Mar 2008, 01:58 PM
Hi George,
unfortunately - this does not help, I also tried mouse up/down, click event - pin still changing (also at your latest sample).

Alex
0
George
Telerik team
answered on 13 Mar 2008, 11:38 AM
Hi Alex Dybenko,

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
0
Alex Dybenko
Top achievements
Rank 2
answered on 17 Mar 2008, 03:05 PM
Hi George,
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

Tags
Window
Asked by
Alex Dybenko
Top achievements
Rank 2
Answers by
George
Telerik team
Alex Dybenko
Top achievements
Rank 2
Share this question
or