Double click on left icon

10 posts, 0 answers
  1. Teodorico
    Teodorico avatar
    39 posts
    Member since:
    Feb 2009

    Posted 17 Jul 2009 Link to this post

    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.

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 22 Jul 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 19 Jul 2011 Link to this post

    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?
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 20 Jul 2011 Link to this post

    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!

  6. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 20 Jul 2011 Link to this post

    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.
  7. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 20 Jul 2011 Link to this post

    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.
  8. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 21 Jul 2011 Link to this post

    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!

  9. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 21 Jul 2011 Link to this post

    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?
  10. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 21 Jul 2011 Link to this post

    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!

  11. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 21 Jul 2011 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017