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

Double click on left icon

9 Answers 51 Views
Window
This is a migrated thread and some comments may be shown as answers.
Teodorico
Top achievements
Rank 1
Teodorico asked on 17 Jul 2009, 12:34 PM

Hi,

Is there a way to detect a double-click on the title icon on the left side? Our users are expecting to close the window by double clicking on it as they would do in a Windows application.

 Thanks.

9 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 22 Jul 2009, 11:30 AM
Hi Teodorico,

Yes, this can be done very easy by using the jQuery library and the client-side API of the RadWindow object. For your convenience I have attached a demo that shows the mentioned approach.

I hope this helps.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
LeBear
Top achievements
Rank 1
answered on 19 Jul 2011, 10:53 PM
Using the latest version (Q2 2011), I'm getting a null response from the attempt to access the title bar:

var oTitleBar = oWindow.GetTitlebar();
alert(oTitleBar);

The alert that pops open is "null".

Of course, if I double-click on the icon, I get the default behavior of the window maximizing, and putting an alert in the function for the double-click shows that the function does not fire.

Can you assist?
0
Marin Bratanov
Telerik team
answered on 20 Jul 2011, 03:30 PM
Hi Barry,

I just tested the solution provided in the last post by Fiko and I can confirm that it works as expected: http://screencast.com/t/JoUQGkoZLA. Please make sure that there isn't a typo in your code and you pass the correct reference to the RadWindow and that there are no other JavaScript errors on the page. If you are still unable to resolve the issue I suggest that you open a support ticked and send us simple, runnable solution that isolates your issue so that we can debug it locally and see what is happening.


Kind regards,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
LeBear
Top achievements
Rank 1
answered on 20 Jul 2011, 05:28 PM
Thank you for checking into this, and sorry for wasting your time.

While the reference to the radWindow was valid, and there were no typos or errors, I was doing this a little too soon in the process.  I changed where the call to the function was made, and it works without issue.

Thanks again.
0
LeBear
Top achievements
Rank 1
answered on 20 Jul 2011, 06:22 PM
I have a follow-up question about the documentation.

At http://www.telerik.com/help/aspnet/window/radwindowobjectclientside.html there is a reference to the GetTitlebar method.  This is apparently old documentation for the ASP.Net Rad Stuff. 

However, at http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html there is no such method.  This latter documentation seems to be current for ASP.Net Ajax Rad Stuff.

Also, given the standards for your methods at this point, shouldn't it be get_titlebar, and might that change at some time in the future?

Thank you.
0
Marin Bratanov
Telerik team
answered on 21 Jul 2011, 11:58 AM
Hello Barry,

Indeed these are documentation articles respectively for the old (Classic) controls and for the current (AJAX) controls. This method in particular is obsolete and is kept only for backwards compatibility. This is the reason why it is not present in the current documentation. I cannot say for certain, but I believe it will not be removed entirely anytime soon, nor will its name change, as it is no longer supported.


Kind regards,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
LeBear
Top achievements
Rank 1
answered on 21 Jul 2011, 12:45 PM
Ok.  I prefer not to implement new code that is dependent on old/unsupported stuff.  Is there a better way to get to the icon?
0
Marin Bratanov
Telerik team
answered on 21 Jul 2011, 01:17 PM
Hello Barry,

Currently the GetTitlebar() method returns a private property that stores the titlebar in a variable and it is not likely to be broken in a future version.

Nevertheless you can use pure jQuery to access the icon, as it has its own CSS class:
function addCloseBehaviorToRwIcon(oWindow)
{
    //var oTitleBar = oWindow.GetTitlebar();
    var rwIcon = $telerik.$(".rwIcon"); // '$telerik.$' get reference to the jQuery object ;
    ...
}



All the best,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
LeBear
Top achievements
Rank 1
answered on 21 Jul 2011, 07:20 PM
Hi Marin,

Thanks for your assistance.

Your suggestion relies on the CSS class of the icon, correct?  Given that, and the fact that there are multiple windows on the page, this wouldn't work, would it?

I'll stick with the current method, then.  If it breaks one day, I can address it then.  This isn't key functionality.
Tags
Window
Asked by
Teodorico
Top achievements
Rank 1
Answers by
Fiko
Telerik team
LeBear
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or