[CLOSED] Button Menu | Tab not working

  1. #1

    [CLOSED] Button Menu | Tab not working

    Hey,

    In button menu, I cant get tab on field to work. Can u check it?

    Also, I dont want menu to collapse on combo box item select. What shud I do?

    <ext:Button runat="server" Text="Contact Details" TabIndex="29" ID="btnContacts" Width="225" LabelWidth="90">
        <Menu>
          <ext:Menu runat="server" ID="menuContacts">
          
          <Items>
          <ext:Panel ID="Panel1" LabelAlign="Top"  runat="server" Layout="table" Width="400" Border="false" ColumnWidth="0.5">
            <LayoutConfig>
                <ext:TableLayoutConfig Columns="2" />
            </LayoutConfig>
            <Items>
                <ext:ComboBox ID="PhoneType1" TabIndex="61" FieldLabel="Contact Method 1" Width="225" runat="server">
                    <Items>
                        <ext:ListItem Text="HOME" Value="HOME" />
                        <ext:ListItem Text="EMAIL" Value="EMAIL" />
                        <ext:ListItem Text="OFFICE" Value="OFFICE" />
                        <ext:ListItem Text="WEBSITE" Value="WEBSITE" />
                        <ext:ListItem Text="MOBILE" Value="MOBILE" />
                        <ext:ListItem Text="FAX" Value="FAX" />
                    </Items>
                    
                </ext:ComboBox>
    
                <ext:TextField ID="PhoneNumber1" TabIndex="62"  FieldLabel="&amp;nbsp;" Text="&amp;nbsp;" LabelSeparator="&amp;nbsp;" runat="server" />
                <ext:ComboBox ID="ComboBox1" TabIndex="61" FieldLabel="Contact Method 1" Width="225" runat="server">
                    <Items>
                        <ext:ListItem Text="HOME" Value="HOME" />
                        <ext:ListItem Text="EMAIL" Value="EMAIL" />
                        <ext:ListItem Text="OFFICE" Value="OFFICE" />
                        <ext:ListItem Text="WEBSITE" Value="WEBSITE" />
                        <ext:ListItem Text="MOBILE" Value="MOBILE" />
                        <ext:ListItem Text="FAX" Value="FAX" />
                    </Items>
                    
                </ext:ComboBox>
                <ext:TextField ID="PhoneNumber5" TabIndex="70"  FieldLabel="&amp;nbsp;" Text="&amp;nbsp;" LabelSeparator="&amp;nbsp;" runat="server" />
            </Items>
          </ext:Panel>
        </Items>
    </ext:Menu>
    </Menu>
    </ext:Button>
  2. #2

    RE: [CLOSED] Button Menu | Tab not working

    Hi,

    1. Please use ComponentMenuItem
    https://examples1.ext.net/#/Toolbar/...trols_In_Menu/

    2. Add the following code to the combos
    <GetListParent Handler="return this.el.up('.x-menu');" />

    3. Add the following code to the menu
    StyleSpec="overflow:visible;"
    4. Add the following properties to the ComponentMenuItem
    Shift="false" Hide&#111;nclick="false"
    Here is the sample
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Button runat="server" Text="Contact Details" TabIndex="29" ID="btnContacts"
            Width="225" LabelWidth="90">
            <Menu>
                <ext:Menu runat="server" ID="menuContacts" StyleSpec="overflow:visible;">
                    <Items>
                        <ext:ComponentMenuItem runat="server" Shift="false" Hide&#111;nclick="false">
                            <Component>
                                <ext:Panel ID="Panel1" LabelAlign="Top" runat="server" Layout="table" Width="400"
                                    Border="false" ColumnWidth="0.5">
                                    <LayoutConfig>
                                        <ext:TableLayoutConfig Columns="2" />
                                    </LayoutConfig>
                                    <Items>
                                        <ext:ComboBox ID="PhoneType1" TabIndex="61" FieldLabel="Contact Method 1" Width="225"
                                            runat="server">
                                            <Items>
                                                <ext:ListItem Text="HOME" Value="HOME" />
                                                <ext:ListItem Text="EMAIL" Value="EMAIL" />
                                                <ext:ListItem Text="OFFICE" Value="OFFICE" />
                                                <ext:ListItem Text="WEBSITE" Value="WEBSITE" />
                                                <ext:ListItem Text="MOBILE" Value="MOBILE" />
                                                <ext:ListItem Text="FAX" Value="FAX" />
                                            </Items>
                                            <GetListParent Handler="return this.el.up('.x-menu');" />
                                        </ext:ComboBox>
                                        <ext:TextField ID="PhoneNumber1" TabIndex="62" FieldLabel="&amp;nbsp;" Text="&amp;nbsp;"
                                            LabelSeparator="&amp;nbsp;" runat="server" />
                                        <ext:ComboBox ID="ComboBox1" TabIndex="61" FieldLabel="Contact Method 1" Width="225"
                                            runat="server">
                                            <Items>
                                                <ext:ListItem Text="HOME" Value="HOME" />
                                                <ext:ListItem Text="EMAIL" Value="EMAIL" />
                                                <ext:ListItem Text="OFFICE" Value="OFFICE" />
                                                <ext:ListItem Text="WEBSITE" Value="WEBSITE" />
                                                <ext:ListItem Text="MOBILE" Value="MOBILE" />
                                                <ext:ListItem Text="FAX" Value="FAX" />
                                            </Items>
                                            <GetListParent Handler="return this.el.up('.x-menu');" />
                                        </ext:ComboBox>
                                        <ext:TextField ID="PhoneNumber5" TabIndex="70" FieldLabel="&amp;nbsp;" Text="&amp;nbsp;"
                                            LabelSeparator="&amp;nbsp;" runat="server" />
                                    </Items>
                                </ext:Panel>
                            </Component>
                        </ext:ComponentMenuItem>
                    </Items>
                </ext:Menu>
            </Menu>
        </ext:Button>
        </form>
    </body>
    </html>
    Last edited by Vladimir; Sep 20, 2010 at 3:56 PM.
  3. #3

    RE: [CLOSED] Button Menu | Tab not working

    Hi,

    Can u explain what each of the mentioned points do? I suppose 1st is for tab and 3rd for not hiding on click. What are 2nd and 4th for? and what is Shift="false"
  4. #4

    RE: [CLOSED] Button Menu | Tab not working

    Hi,

    1. ComponentMenuItem which allows to integrate controls inside menu. It automatically handles many cases to allow the control works correctly inside menu

    2. GetListParent of the Combobox
    ExtJS docs
    getListParent() : void<div class="mdesc" style="margin: 0px; padding: 5px 0px; color: rgb(68, 68, 68);"><div class="long" style="margin: 0px; padding: 0px; display: block; line-height: 18px;"><p style="margin: 0px; padding: 0px;">Returns the element used to house this ComboBox's pop-up list. Defaults to the document body.</p>A custom implementation may be provided as a configuration option if the floating list needs to be rendered to a different Element. An example might be rendering the list inside a Menu so that clicking the list does not hide the Menu:<code style="font-style: normal; font-weight: normal; font-size: 12px; color: rgb(0, 0, 0); line-height: 16px ! important; font-family: 'Lucida Console','Courier New',Courier,monospace;"><b style="font-weight: normal; color: rgb(128, 0, 128);">var[/b] store = <b style="font-weight: normal; color: rgb(128, 0, 128);">new[/b] Ext.data.ArrayStore({
    autoDestroy: true,
    fields: [<em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'initials'[/i], <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'fullname'[/i]],
    data : [
    [<em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'FF'[/i], <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'Fred Flintstone'[/i]],
    [<em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'BR'[/i], <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'Barney Rubble'[/i]]
    ]
    });

    <b style="font-weight: normal; color: rgb(128, 0, 128);">var[/b] combo = <b style="font-weight: normal; color: rgb(128, 0, 128);">new[/b] Ext.form.ComboBox({
    store: store,
    displayField: <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'fullname'[/i],
    emptyText: <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'Select a name...'[/i],
    forceSelection: true,
    getListParent: <b style="font-weight: normal; color: rgb(128, 0, 128);">function[/b]() {
    <b style="font-weight: normal; color: rgb(128, 0, 128);">return[/b] this.el.up(<em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'.x-menu'[/i]);
    },
    iconCls: <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'no-icon'[/i], <i style="font-weight: normal; font-style: normal; color: rgb(153, 153, 153);">//use iconCls <b style="font-weight: normal; color: rgb(153, 153, 153); font-style: normal;">if[/b] placing within menu to shift to right side of menu[/i]
    mode: <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'local'[/i],
    selectOnFocus: true,
    triggerAction: <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'all'[/i],
    typeAhead: true,
    width: 135
    });

    <b style="font-weight: normal; color: rgb(128, 0, 128);">var[/b] menu = <b style="font-weight: normal; color: rgb(128, 0, 128);">new[/b] Ext.menu.Menu({
    id: <em style="font-style: normal; font-weight: normal; color: rgb(0, 128, 128); background-color: rgb(238, 238, 238);">'mainMenu'[/i],
    items: [
    combo <i style="font-weight: normal; font-style: normal; color: rgb(153, 153, 153);">// A Field <b style="font-weight: normal; color: rgb(153, 153, 153); font-style: normal;">in[/b] a Menu[/i]
    ]
    });</code><div class="mdetail-params" style="margin: 10px 0px 0px; padding: 0px 0px 0px 12px; font-size: 12px;"><strong style="font-style: normal; font-weight: bold; display: block; margin-bottom: 3px; font-size: 11px; color: rgb(85, 85, 85);">Parameters:[/b]<ul style="margin: 12px; padding: 0px; list-style-type: circle; list-style-position: inside;"><li style="margin: 0px; padding: 0px; list-style-position: inside; list-style-type: circle;">None.[/list]<strong style="font-style: normal; font-weight: bold; display: block; margin-bottom: 3px; font-size: 11px; color: rgb(85, 85, 85);">Returns:[/b]<ul style="margin: 12px; padding: 0px; list-style-type: circle; list-style-position: inside;"><li style="margin: 0px; padding: 0px; list-style-position: inside; list-style-type: circle;">void[/list]



    It is used to determine correctly zindex of the dropdown list. Please note that if you place combo inside ComponentMenuItem as main component then set GetListParent is not required

    3. StyleSpec="overflow:visible;" for the menu
    GetListParent constrains combo by some element (element which is returned by that method). Therefore our combo list cannot be showed outside menu (just remove StyleSpec to see effect).
    'overflow:visible' disable clipping for the element

    4. Shift="false"
    By default, all menu items are shiffted to the right, you can see the space for icon and vertical line. That option removes shiffting (it is ComponentMenuItem option only)

    5. Hide&#111;nclick="false"
    hideOnClick : Boolean<div class="mdesc" style="margin: 0px; padding: 5px 0px; color: rgb(68, 68, 68);"> True to hide the containing menu after this item is clicked (defaults to true)

Similar Threads

  1. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  2. [CLOSED] When button click, open the menu of button
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 22, 2012, 4:23 PM
  3. [CLOSED] Dynamically generate button and button menu problem.
    By csssi_coolite in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Dec 22, 2011, 5:02 AM
  4. [CLOSED] Button Menu, without the button
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 22, 2010, 8:10 PM
  5. Context Menu Not Working
    By EzaBlade in forum 1.x Help
    Replies: 7
    Last Post: May 14, 2009, 12:41 PM

Tags for this Thread

Posting Permissions