[CLOSED] Autocomplete combobox question

  1. #1

    [CLOSED] Autocomplete combobox question

    I have a combobox that is being used in 'autocomplete' mode. The store attached is using an ajaxproxy that filters the data returned from a service (a .net handler). It is set with a querydelay of 1500 and is also set that you have to type at least 3 characters before it calls to get the store data.

    My question: is there a setting to bypass the querydelay if the user hits the enter key?

    <ext2:ComboBox 
        ID="Results" 
        runat="server" 
        ValueField="Key"
        TypeAhead="false" 
        LoadingText="Searching..."
        HideTrigger="true" 
        ItemSelector="div.search-item" 
        EmptyText="Type to Search" 
        QueryDelay="1500" 
        QueryCaching="false"
        MinChars="1" 
        Border="false"
        Width="921" 
        Height="38">
        <Store>
            <ext2:Store ID="ResultStore" runat="server" AutoLoad="false">
                <Proxy>
                    <ext2:AjaxProxy Url="~/QuickSearch.ashx">
                        <Reader>
                            <ext2:JsonReader IDProperty="Key" Root="results" TotalProperty="total" />
                        </Reader>
                    </ext2:AjaxProxy>
                </Proxy>
                <Model>
                    <ext2:Model runat="server">
                        <Fields>
                            <ext2:ModelField Name="Key" />
                            <ext2:ModelField Name="Description" />
                            <ext2:ModelField Name="Icon" />
                            <ext2:ModelField Name="Info" />
                        </Fields>
                    </ext2:Model>
                </Model>
            </ext2:Store>
        </Store>
        <ListConfig>
            <ItemTpl runat="server">
                <Html>
                    <tpl for=".">
                        <div class="search-item">
                            <span id="quicksearch-title">
                                <img src="{Icon}" style="padding-right:10px; vertical-align:middle;" />
                                {Description}
                            </span>
                            <span id="quicksearch-info">{Info}</span>
                        </div>
                    </tpl>
                </Html>
            </ItemTpl>
        </ListConfig>
        <DirectEvents>
            <Select OnEvent="Results_Select">
                <EventMask ShowMask="true" Target="Page" />
                <ExtraParams>
                    <ext2:Parameter Name="Key" Value="this.getValue()" Mode="Raw" />
                </ExtraParams>
            </Select>
        </DirectEvents>
    </ext2:ComboBox>
    Last edited by Daniil; Jul 09, 2015 at 3:42 PM. Reason: [CLOSED]
  2. #2
    Hello,

    The following sample executes a query to filter the dropdown list when ENTER key is pressed.

    <script>
        var specialKey = function (combo, e) {
            if (e.getKey() == e.ENTER) {
                combo.doQuery(combo.getRawValue(), true);
            }
        };
    </script>
    <ext2:ComboBox 
        ID="Results" 
        runat="server" 
        ValueField="Key"
        TypeAhead="false" 
        LoadingText="Searching..."
        HideTrigger="true" 
        ItemSelector="div.search-item" 
        EmptyText="Type to Search" 
        QueryDelay="1500" 
        QueryCaching="false"
        MinChars="1" 
        Border="false"
        Width="921" 
        Height="38">
        <Store>
            <ext2:Store ID="ResultStore" runat="server" AutoLoad="false">
                <Proxy>
                    <ext2:AjaxProxy Url="~/QuickSearch.ashx">
                        <Reader>
                            <ext2:JsonReader IDProperty="Key" Root="results" TotalProperty="total" />
                        </Reader>
                    </ext2:AjaxProxy>
                </Proxy>
                <Model>
                    <ext2:Model runat="server">
                        <Fields>
                            <ext2:ModelField Name="Key" />
                            <ext2:ModelField Name="Description" />
                            <ext2:ModelField Name="Icon" />
                            <ext2:ModelField Name="Info" />
                        </Fields>
                    </ext2:Model>
                </Model>
            </ext2:Store>
        </Store>
        <ListConfig>
            <ItemTpl runat="server">
                <Html>
                    <tpl for=".">
                        <div class="search-item">
                            <span id="quicksearch-title">
                                <img src="{Icon}" style="padding-right:10px; vertical-align:middle;" />
                                {Description}
                            </span>
                            <span id="quicksearch-info">{Info}</span>
                        </div>
                    </tpl>
                </Html>
            </ItemTpl>
        </ListConfig>
        <Listeners>
            <SpecialKey Fn="specialKey" />
        </Listeners>  
        <DirectEvents>
            <Select OnEvent="Results_Select">
                <EventMask ShowMask="true" Target="Page" />
                <ExtraParams>
                    <ext2:Parameter Name="Key" Value="this.getValue()" Mode="Raw" />
                </ExtraParams>
            </Select>
        </DirectEvents>
    </ext2:ComboBox>

Similar Threads

  1. [CLOSED] ComboBox TwoColumn Autocomplete not working ?
    By sisa in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 08, 2013, 11:36 AM
  2. [CLOSED] Razor - Combobox autocomplete not working
    By OriCoder in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Feb 07, 2013, 2:16 PM
  3. ComboBox AutoComplete with Fuzzy query
    By Johnnywwh in forum 2.x Help
    Replies: 0
    Last Post: Nov 22, 2012, 2:54 AM
  4. Combobox autocomplete - blank situation
    By SouthDeveloper in forum 1.x Help
    Replies: 2
    Last Post: Oct 21, 2009, 5:03 PM
  5. Replies: 1
    Last Post: May 19, 2009, 7:30 AM

Posting Permissions