[OPEN] [#799] Menu with iFrame content Closes on any click

  1. #1

    [OPEN] [#799] Menu with iFrame content Closes on any click

    We are upgrading our application from version 2.5 to 3.1 and encountered an issue with menu that have a panel with content loaded in frames.
    On any click on the frame the menu is triggering the lostfocus event and hides itself. that has not been the case before.
    here is an example:
        <ext:Toolbar runat="server" Width="500">
            <Items>
                <ext:Button runat="server" Text="Form controls" Icon="NoteEdit">
                    <menu>
                        <ext:Menu runat="server">
                            <items>
                                <ext:Panel runat="server" Width="200" Height="400">
                                    <Loader Url="Webform1.aspx" Mode="Frame" />
                                    
                                </ext:Panel>
                            </items>
                        </ext:Menu>
                    </menu>
                </ext:Button>
            </Items>
        </ext:Toolbar>
    and the child page code
        <ext:ResourceManager runat="server" />
        <ext:Panel runat="server">
            <Items>
                <ext:TextField runat="server" Text="Hello world!" />
            </Items>
        </ext:Panel>
    any click to change the content of the textfield closes the menu
    Last edited by fabricio.murta; Dec 29, 2015 at 6:24 PM. Reason: s/ranat/runat/g
  2. #2
    Hi @baruch.gabo,

    Yes, there is a problem. I am trying to find a workaround.
  3. #3
    Were you able to find any workaround, other then putting the iframe view contents in the main page?
  4. #4
    Sorry for the delay. I wanted to try once again before answering.

    I was unable to find a workaround. But, actually, it doesn't mean that there is no workaround...

    other then putting the iframe view contents in the main page
    Is it an option for you?
  5. #5
    Not the best solution. The iframe content is complex and it clutters the main view code. But it will have to do for now.
    Is this a bug with the new EXTJS or the new way menus behave.
  6. #6
    Not the best solution. The iframe content is complex and it clutters the main view code.
    Maybe, organize that content as a user control?

    Is this a bug with the new EXTJS or the new way menus behave.
    I think it is a bug.

    The new focus managing system has been introduced in ExtJS 5.1 and it broke some scenarios like the one that we are discussing. Personally, I hope that the situation will be improved in ExtJS 5.1.1.

    Created an Issue to track the defect.
    https://github.com/extnet/Ext.NET/issues/799
  7. #7
    Thanks for the help.
  8. #8
    Here's the workaround:
    <Listeners>
        <BeforeHide Handler="if (document.activeElement.id == item.down().down().id) { console.log('focus inside'); return false; }" />
    </Listeners>
    Add this inside the menu in the parent page (the one with the Loader panel).

    EDIT: credits: Detecting when an iframe gets or loses focus stackoverflow question.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: Mar 04, 2014, 2:20 PM
  2. Replies: 3
    Last Post: Jan 17, 2014, 12:29 PM
  3. [CLOSED] menu not automatically close if click the iframe
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 10, 2011, 5:57 AM
  4. [CLOSED] Menu closes on DateField trigger click
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 20, 2011, 7:54 PM
  5. Get iframe content
    By Dgsoft.ru in forum 1.x Help
    Replies: 0
    Last Post: Apr 16, 2009, 2:46 PM

Tags for this Thread

Posting Permissions