[CLOSED] Custom Search Combobox entry

  1. #1

    [CLOSED] Custom Search Combobox entry

    Hi,

    I am using the custom search combobox, when I try to enter some text, it retrieves the data based on the text. However, it by default selects the first entry in the dropdown box. So, if a user presses the tab button, it selects the first record.

    Example:

    user enters: jo
    it displays: John (default selected), Josh

    At this point if the user presses the tab button,

    Current behavior: John is displayed in the text area and the focus goes to the next control in the form
    My requirement: jo should be displayed in the text area and the focus should go to the next control. If the user presses the down arrow in the dropdown and presses the enter button, it should select it at that point.

    Please help..it's very urgent.

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="HospitalPhysiciansListControl.ascx.cs" Inherits="HospitalPhysiciansListControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <ext:Store ID="PhysicianListControlStore" 
        runat="server"
        OnRefreshData="RefreshPhysicians" >
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Mapping="HospitalPhysicianId" Name="HospitalPhysicianId" />
                    <ext:RecordField Mapping="PhysicianName" Name="PhysicianName" />
                    <ext:RecordField Mapping="HomePhoneNumber" Name="HomeNumber" />
                    <ext:RecordField Mapping="PagerNumber" Name="PagerNumber" />
                    <ext:RecordField Mapping="MobileNumber" Name="MobileNumber" />
                    <ext:RecordField Mapping="WorkNumber" Name="WorkNumber" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Field="PhysicianName" Direction="ASC" />
    </ext:Store>
    
    <ext:ComboBox ID="cmbHospitalPhysicians"
             Width="400" 
             runat="server" 
             StoreID="PhysicianListControlStore" 
             TypeAhead="false"
             ListClass="TableTextBox"
             HideTrigger="true" 
             LoadingText="Searching..."
             Editable="true"
             ForceSelection="false"
             AutoFocus="false"
             MinChars="0"
             EnableKeyEvents="true"
             DisplayField="PhysicianName" 
             ValueField="PhysicianName"
             FieldClass="RequiredTextField"
            EmptyClass="RequiredTextField"
            InvalidClass="RequiredTextField"
            TabIndex="3"
            AllowBlank="false">
            <Listeners>
                <Select Fn="PhysicianSelected" />
            </Listeners>
    </ext:ComboBox>
    Thanks,
    Sriram.
    Last edited by Daniil; Apr 01, 2011 at 1:09 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please wrap the code you posted in [CODE] tags, see
    Forum Guidelines For Posting New Topics
  3. #3
    Sorry about that! Here is the code..

    Thanks,
    Sriram.

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="HospitalPhysiciansListControl.ascx.cs" Inherits="HospitalPhysiciansListControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <ext:Store ID="PhysicianListControlStore" 
    runat="server"
    OnRefreshData="RefreshPhysicians" >
    <Proxy>
    <ext:PageProxy />
    </Proxy>
    <Reader>
    <ext:JsonReader>
    <Fields>
    <ext:RecordField Mapping="HospitalPhysicianId" Name="HospitalPhysicianId" />
    <ext:RecordField Mapping="PhysicianName" Name="PhysicianName" />
    <ext:RecordField Mapping="HomePhoneNumber" Name="HomeNumber" />
    <ext:RecordField Mapping="PagerNumber" Name="PagerNumber" />
    <ext:RecordField Mapping="MobileNumber" Name="MobileNumber" />
    <ext:RecordField Mapping="WorkNumber" Name="WorkNumber" />
    </Fields>
    </ext:JsonReader>
    </Reader>
    <SortInfo Field="PhysicianName" Direction="ASC" />
    </ext:Store>
    
    <ext:ComboBox ID="cmbHospitalPhysicians"
    Width="400" 
    runat="server" 
    StoreID="PhysicianListControlStore" 
    TypeAhead="false"
    ListClass="TableTextBox"
    HideTrigger="true" 
    LoadingText="Searching..."
    Editable="true"
    ForceSelection="false"
    AutoFocus="false"
    MinChars="0"
    EnableKeyEvents="true"
    DisplayField="PhysicianName" 
    ValueField="PhysicianName"
    FieldClass="RequiredTextField"
    EmptyClass="RequiredTextField"
    InvalidClass="RequiredTextField"
    TabIndex="3"
    AllowBlank="false">
    <Listeners>
    <Select Fn="PhysicianSelected" />
    </Listeners>
    </ext:ComboBox>
  4. #4
    Thanks.

    Please add
    var onRender = function () {
        this.keyNav.tab = function () {
            this.collapse();
        };
    }
    
    ****
    <ext:ComboBox ...>
        ...
        <Listeners>
            <AfterRender Fn="onRender" />
        </Listeners>
    </ext:ComboBox>

Similar Threads

  1. [CLOSED] Custom Search Combobox
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 02, 2011, 1:40 PM
  2. custom search in combobox
    By aditya.murthy88@gmail.com in forum 1.x Help
    Replies: 0
    Last Post: Feb 05, 2011, 8:57 AM
  3. [CLOSED] Custom Search Combobox
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 04, 2010, 7:29 PM
  4. ComboBox Custom Search Example
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Aug 15, 2009, 10:59 PM
  5. ComboBox Custom Search example
    By echo in forum 1.x Help
    Replies: 1
    Last Post: Jul 01, 2009, 1:27 PM

Tags for this Thread

Posting Permissions