Weird radopen bug

5 posts, 1 answers
  1. John Schroeder
    John Schroeder avatar
    11 posts
    Member since:
    Nov 2009

    Posted 20 Sep 2011 Link to this post

    Hi,

    I have a weird issue with radwindow controls in my project. I have a grid with an edit linkbutton column which opens a radwindow with details for that particular item. Inside of this radwindow I have another grid with a edit column in it which also opens another radwindow using oBrowserWnd.radopen to show the details of the selected grid item. Everything so far works fine, the bug I'm encountering is that if the edit template field is an img tag the radwindow will appear behind the currently open radwindow but if I switch the img tag for a regular anchor tag which uses the exact same js code to open the window, the actual window is displayed properly in front of the parent window. Now I've tried to further test this by using an anchor tag with text set to "Edit" and it has an img tag as its child. Now, if I click on the "Edit" text the radwindow opens up fine in the front of the current radwindow but if I click on the img tag nested inside the anchor the radwindow opens but its behind the current radwindow. This is way weird. Any ideas on how to resolve this issue?

    Best regards.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4609 posts

    Posted 21 Sep 2011 Link to this post

    Hi John,

    Please try wrapping the radopen call in a setTimeout() function:
    function openRadWin()
    {
        setTimeout(function ()
        {
            GetRadWindow().BrowserWindow.radopen('Default3.aspx', null);
        }, 0);
    }

    even 0 milliseconds should suffice. This timeout is often necessary when opening a RadWindow from within another RadWindow, because the browser needs it to properly set the active object. Sometimes it is not set correctly, because the entire RadWindow markup is rendered in the moment when it needs to be shown.

    Best wishes,
    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
  3. John Schroeder
    John Schroeder avatar
    11 posts
    Member since:
    Nov 2009

    Posted 21 Sep 2011 Link to this post

    Hi Marin,

    That didn't solve my problem. I'm not sure if you understand my issue. My radopen code works fine if i click the text in the <a tag. The windows opens up in front like it should. It's only when I use the img tag to lunch the code where the issue happens. Take a look at ItemTemplate below:

                                        <telerik:GridTemplateColumn DataField="SyncGuid">
                                            <ItemTemplate>
                                                <a href="#" onclick="openTemplateDetailsDelay('<%# DataBinder.Eval(Container, "DataItem.SyncGuid") %>');">Edit
                                                    <img src="../images/icon_edit.png" alt="" />
                                                </a>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>

    Now I have an anchor tag (a) with InnerText set to Edit but it also contains an <img tag as well. Clicking the img tag opens up the radwindow in the background while clicking the Edit text opens it up in the front. I've tried your solution, delaying the method doesn't fix it. The img tag issue happens no matter if I put it ouside of the <a tag or inside. It's simply the tag itself the problem here.
  4. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    4609 posts

    Posted 22 Sep 2011 Link to this post

    Hello John,

    I tested this template with the timeout and things seem to be working as expected: http://screencast.com/t/h8soEOFJh. I used a dummy datasource and changed the image src to an image in my project, but I do not believe these are relevant to the case. I am also attaching my test page as a reference. Please compare it with your project and see what the differences are. I would advise that you make sure that you have updated the code accordingly with the timeout and that the correct function is called.


    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
  5. John Schroeder
    John Schroeder avatar
    11 posts
    Member since:
    Nov 2009

    Posted 22 Sep 2011 Link to this post

    Hi Marin,

    Now that works. Thanks a lot for your help.

    Best regards.
Back to Top