[CLOSED] ComboBox Focus Expanded

Page 2 of 2 FirstFirst 12
  1. #11
    Quote Originally Posted by Daniil View Post
    Hi,Yes, please provide a full (but simplified) and runnable test case to reproduce the problem.
    Edit: Here is the modified Code.

    <%@ Page Language="C#" AutoEventWireup="True" CodeBehind="ManageContracts.aspx.cs"  Inherits="Acris.Web.Contracts.ManageContracts" EnableViewState="false" %>
    <%@ 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 id="Head1" runat="server">
        
        <ext:ResourcePlaceHolder Mode="Script" ID="ScriptContainer1" runat="server" />
         
    </head>
    <body>
    
    
    <script runat="server">
       protected void Page_Load(object sender, EventArgs e)
            {     
    
    
                    this.Store1.DataSource = new object[]
                    {
                        new object[]{"AL", "Alabama", "The Heart of Dixie", 5.99},
                        new object[] { "AK", "Alaska", "The Land of the Midnight Sun", 5.99},
                        new object[] { "AZ", "Arizona", "The Grand Canyon State", 5.99},
                        new object[] { "AR", "Arkansas", "The Natural State", 5.99},
                        new object[] { "CA", "California", "The Golden State", 5.99},
                        new object[] { "CO", "Colorado", "The Mountain State", 5.99}            
                    };
    
    
                    this.Store1.DataBind();
    
    
               
            }
    </script>
    
    
    
    
        <form id="form1" runat="server">
        <ext:ResourceManager ID="rs1" runat="server" StateProvider="None" />
         
        <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="abbr" />
                            <ext:RecordField Name="state" />
                            <ext:RecordField Name="nick" />
                            <ext:RecordField Name="price" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>            
            </ext:Store>
    
    
       
        <%--Formulario--%>
        <ext:Viewport ID="Viewport1" runat="server">
            <Content>
               <table>
               <tr>             
                 <td>
                 <ext:ComboBox ID="cbContrT" runat="server" StoreID="Store1" AllowBlank="false"
                    Width="130" DisplayField="Description" ValueField="UniqueId" TypeAhead="true"
                    Mode="Local" TriggerAction="All" ItemSelector="div.list-item" SelectOnFocus="false" 
                    AutoFocus="true" AutoFocusDelay="500">
                    <Template ID="Template11" runat="server">
                        <Html>
                        <tpl for=".">
                        <div class="list-item">
                             <h3>{state}</h3>
                        </div>
                    </tpl>
                        </Html>
                    </Template>
                </ext:ComboBox>             
                 </td>
                 </tr>                      
                 </table>
                                       
                                       
             </Content>
            <Listeners>
                <Render Handler="#{cbContrT}.focus();" Delay="100" />
            </Listeners>
        </ext:Viewport>
        
        </form>
    </body>
    </html>
    Attached Thumbnails Click image for larger version. 

Name:	Dibujo.jpg 
Views:	147 
Size:	25.9 KB 
ID:	5426  
    Last edited by jeybonnet; Jan 16, 2013 at 11:01 AM.
  2. #12
    Please see #1, #3 and Code Samples here.
    More Information Required
  3. #13
    Quote Originally Posted by Daniil View Post
    Please see #1, #3 and Code Samples here.
    More Information Required
    Ok I modified the code, and you have it in the post.

    Here is the result on image:

    Click image for larger version. 

Name:	Dibujo.jpg 
Views:	145 
Size:	4.5 KB 
ID:	5427
  4. #14
    Thank you.

    Please try:
    <AfterRender Handler="#{cbContrT}.focus();" Delay="200" />
    instead of the Render listener.
  5. #15
    Quote Originally Posted by Daniil View Post
    Thank you.

    Please try:
    <AfterRender Handler="#{cbContrT}.focus();" Delay="200" />
    instead of the Render listener.
    With 200 not works, but if i put 250, it works.

    It works with the example that i send it, but not with the code of my application.
  6. #16
  7. #17
    Edited:

    I have overlooked that here are 2 pages instead of 1. sorry
  8. #18
    To avoid delays (I always try to avoid if possible) I can suggest the following.

    1. Set up AutoLoad="false" for the Store.

    2. Remove AutoFocus="true" and AutoFocusDelay="500" of the ComboBox.

    3. Remove AfterRender/Render listeners of the Viewport.

    4. Set up this listener for the ComboBox.

    <Render Handler="item.getStore().load({
                         callback: function () {
                             item.focus();
                         } 
                     });" />
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 3
    Last Post: Nov 05, 2013, 9:34 AM
  2. [CLOSED] How to Populate Combobox on Focus?
    By ISI in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 01, 2011, 5:16 PM
  3. [CLOSED] [1.0] Selecting Combobox expanded list item through Tab key
    By r_honey in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 02, 2010, 4:54 PM
  4. [CLOSED] ComboBox Blur or Lose Focus
    By Steve in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 03, 2009, 3:55 AM

Tags for this Thread

Posting Permissions