[CLOSED] [1.0] Modal window tabindex

Page 3 of 3 FirstFirst 123
  1. #21
    Well, .AddKeyBinding() really requires an ajax request (DirectEvent).

    To add the KeyBinding during initial page load, please use
    this.KeyMap1.Keys.Add()
    Example
    <%@ Page Language="C#" %>
      
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.KeyMap1.Keys.Add(new KeyBinding()
            {
                Keys =
                {
                    new Key() 
                    {
                        Code = KeyCode.TAB   
                    }
                },
                Listeners =
                {
                    Event =
                    {
                        Handler = @"if (!e.shiftKey) { 
                                        if (Button2.focused) { 
                                            e.stopEvent(); 
                                            DateField1.focus(); 
                                        } 
                                    } else { 
                                        if (DateField1.focused) { 
                                            e.stopEvent(); 
                                            Button2.focus(); 
                                        } 
                                    }"
                    }
                }
            });
        }
    </script>
      
    <!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>Ext.Net Example</title> 
      
        <script type="text/javascript">
            var onFocus = function (e, t, o) {
                this.focused = true;
            }
      
            var onBlur = function (e, t, o) {
                this.focused = false;
            } 
        </script> 
      
    </head> 
    <body> 
        <form runat="server"> 
        <ext:ResourceManager runat="server" /> 
        <ext:KeyMap ID="KeyMap1" runat="server" Target="={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}" /> 
        <ext:Button runat="server" Text="Show window"> 
            <Listeners> 
                <Click Handler="Window1.show();" /> 
            </Listeners> 
        </ext:Button> 
        <ext:Window
            ID="Window1"
            runat="server"
            Modal="true"
            Height="300"
            Hidden="true"> 
            <Items> 
                <ext:DateField ID="DateField1" runat="server"> 
                    <Listeners> 
                        <Blur Fn="onBlur" /> 
                        <Focus Fn="onFocus" /> 
                    </Listeners> 
                </ext:DateField> 
                <ext:TextField ID="TextField1" runat="server" /> 
                <ext:TextField ID="TextField2" runat="server" /> 
            </Items> 
            <Buttons> 
                <ext:Button ID="Button2" runat="server" Text="Some buttom"> 
                    <Listeners> 
                        <AfterRender Handler="this.btnEl.on('focus', onFocus, this); 
                                              this.btnEl.on('blur', onBlur, this);" /> 
                        <Click Handler="alert('Hello!');" /> 
                    </Listeners> 
                </ext:Button> 
            </Buttons> 
            <Listeners> 
                <Show Handler="DateField1.focus();" Delay="100" /> 
            </Listeners> 
        </ext:Window> 
        </form> 
    </body> 
    </html>
  2. #22

    Focus on combo box

    I've adapted this to a master page and it work very well, thanks.

    Next question: How can i give focus to a combo box and keep it collapsed? I have tried calling collapse after .focus, but the drop down still remains expanded.
  3. #23
    Please start a new thread, because this question is not related to the current thread.

    I'm marking this thread as closed.
  4. #24
    focus is directly related to tab index.
  5. #25
    Yes, I have to agree with you - focus is related.

    But ,I think, a combo's list - expanded or collapsed - is not rather related to tab index, isn't that so?
  6. #26
    Here is a related v2 discussion.
    http://forums.ext.net/showthread.php?25717
Page 3 of 3 FirstFirst 123

Similar Threads

  1. [CLOSED] Modal window and form tag
    By sbg in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 28, 2013, 6:39 AM
  2. Replies: 5
    Last Post: Apr 20, 2012, 6:20 AM
  3. [CLOSED] Ext.Window: Question about clicking outside a modal Window
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 07, 2012, 6:00 AM
  4. [CLOSED] X.Msg with Modal Window
    By jwf in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 20, 2011, 9:22 PM
  5. Modal Window
    By erey in forum 1.x Help
    Replies: 0
    Last Post: Mar 29, 2010, 12:06 PM

Tags for this Thread

Posting Permissions