RadAlert on top disabling application

3 posts, 0 answers
  1. Luis
    Luis avatar
    14 posts
    Member since:
    Jun 2009

    Posted 13 Mar 2012 Link to this post

    Hello,

    some days before I faced a strange behavior. I tried to show a radAlert window, from a modal radWindow, on top of all windows, so I set its z-index clientside like this:

    _radalert.get_popupElement().style.zIndex = 100000;

    The problem was that the radAlert was shown on top, but the gray-color panel was placed behind the radWindow, so the radWindow remained active, not disabled.

    Finally I found a solution, setting this property, too:

    _radalert.get_popupElement().style.zIndex = 100001;
    _radalert._modalExtender._backgroundElement.style.zIndex = 100000;


    What I would like to know is if there is a public property or a 'get' method to access the private object "_modalExtender"

    Thanks in advance.
  2. Luis
    Luis avatar
    14 posts
    Member since:
    Jun 2009

    Posted 13 Mar 2012 Link to this post

    It's surprising for me.

    This solution only works for the first time. I don't know if it is a reasonable behavior, but every new radWindows has, as zindex value, the value of the last radWindow incremented, by one I suppose, so when the first radAlert is shown and its zindex modified with my code, next radWindow will have a zindex greater than 100000.

    I have modified my code, and now it seems to work:
    (no reason to choose 5, could be another number)

    _radalert.get_popupElement().style.zIndex += 5;
    _radalert._modalExtender._backgroundElement.style.zIndex += 5;

  3. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5363 posts

    Posted 14 Mar 2012 Link to this post

    Hi Luis,

    Since you already have found a way to get things working in  your scenario you can keep using it if it fits your needs. Nevertheless, below I will answer your questions and provide some more information on the way the control works:

    1) if there is a public property or a 'get' method to access the private object "_modalExtender"
    No, there isn't. This is part of the internal control's functionality and for common tasks that use it there is a public method that wraps the functionality (e.g. set_modal()). Having the need to externally modify something from this layer is very rare.

    2) every new radWindows has, as zindex value, the value of the last radWindow incremented
    Yes, this is true for the RadWindows from the RadWindowManager's Windows collection. This is necessary for the proper functioning of the control, because setting an active RadWindow requires that you increase its z-index value, as this is the only way to bring an HTML element to the front. This is why the RadWindowManager tracks the z-index values it has assigned so far and opens the next one with a higher value. The same applies for the predefined dialogs as well, so if you open your first RadWindow from the manager you shouldn't have such an issue if you have configured the z-index properly.

    To get ahead and answer the "how do I configure it properly" question - set the property to the manager, e.g.:
    <telerik:RadWindowManager runat="server" ID="rwm1" Style="z-index:10000">
            <Windows>
                 . . . . .
    and not for the individual RadWindow. Setting it for the individual control means you always want this z-index and  the manager cannot properly calculate the further values.


    Kind regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top