[CLOSED] combo in compositefield in menu closing menu on selection

  1. #1

    [CLOSED] combo in compositefield in menu closing menu on selection

    I'm trying to build a menu that lets the user select some date ranges from a variety of different methods. ComponentMenuItem seems to be intended for preventing form fields from impacting the menu, but it does not seem to help in the case where it contains a CompositeField (or a Panel) that contains controls that pop things up. In this case, the menu closes as soon as a selection is made on the combo. (I also have a variation with DateFields where the menu disappears when the datepicker is launched, but I'm guessing that the treatment will be the same.)

    The code below lays out the item in question. Any pointers on what I should be doing? I haven't worked much with the floating stuff so I don't know how it keeps track of what owns what.

    <ext:Menu runat="server" ID="TestMenu" ShowSeparator="false" Cls="menu-noicon">
        <Items>
            <ext:MenuItem runat="server" Text="Year starting at">
                <Menu>
                    <ext:Menu runat="server" ShowSeparator="false">
                        <Items>
                            <ext:ComponentMenuItem runat="server" Shift="false">
                                <Component>
                                    <ext:CompositeField runat="server" Width="150">
                                        <Items>
                                            <ext:SpinnerField ID="SpinnerField1" runat="server" Text="2011" Flex="1" />
                                            <ext:ComboBox runat="server" ID="ComboBox2"
                                                Width="40"
                                                Editable="false"
                                                Text="Q1"
                                                 Margins="0 0 0 5px">
                                                <Items>
                                                    <ext:ListItem Text="Q1" Value="0" />
                                                    <ext:ListItem Text="Q2" Value="3" />
                                                    <ext:ListItem Text="Q3" Value="6" />
                                                    <ext:ListItem Text="Q4" Value="9" />
                                                </Items>
                                            </ext:ComboBox>
                                            <ext:Button runat="server" Text="OK" Margins="0 0 0 5px" />
                                        </Items>
                                    </ext:CompositeField>
                                </Component>
                            </ext:ComponentMenuItem>
                        </Items>
                    </ext:Menu>
                </Menu>
            </ext:MenuItem>
        </Items>
    </ext:Menu>
    Additionally, I also noted that listeners can't be configured on the ComponentMenuItem through the markup. I was looking to stick stuff in there on afterrender while I was testing this.
    Last edited by geoffrey.mcgill; Jan 18, 2015 at 10:32 PM.
  2. #2
    Hi,

    Well, it's the behavior of floating elements.

    The solution can look something like this:
    http://forums.ext.net/showthread.php?14757

    But it's not easy to implement, so, I'd suggest to consider to use, for example, collapsible/expandable <ext:Panel> or a separate <ext:Window> for such settings.
    Last edited by geoffrey.mcgill; Jan 19, 2015 at 12:52 AM.
  3. #3
    Thanks Daniil. I spent several hours poking around in there and finally realized what ComponentMenuItem was doing - it's swapping in other types of MenuItems depending on the component type requested. From that, I could see the individual changes that have to be made, and it's definitely more complicated than I should get into for this. I will try a different design.

Similar Threads

  1. Replies: 0
    Last Post: Aug 09, 2012, 5:37 AM
  2. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  3. Combo in Menu
    By Carlos Caetano in forum 1.x Help
    Replies: 1
    Last Post: Aug 08, 2011, 6:02 PM
  4. [CLOSED] Splitbutton with Menu - Make the menu expand upwards?
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 02, 2011, 1:18 PM
  5. Menu selection
    By vedaantees in forum 1.x Help
    Replies: 3
    Last Post: Mar 01, 2011, 12:51 AM

Posting Permissions