Results 1 to 4 of 4

Thread: ComboBox search on individual string components

  1. #1
    Ext User
    Join Date
    Sep 2010
    Location
    Canada
    Posts
    12

    Default ComboBox search on individual string components

    Hi,

    I have a ComboBox with it's mode set to local. I have a set of hard-coded values in a store that are retrieved by the ComboBox. My problem is that the search seems to work only for the entire string, from left to right, and not parts of it. For example, if one my values is 'The cat and the rat caught a big bat,' I only get this string back if I start typing 'The cat and . . . .' But not if I type just 'cat,' 'rat,' 'big' etc. Please help. Here's the code I have so far:

    Code:
    new Ext.form.ComboBox ({
    
    hideTrigger: true ,hideLabel: true ,triggerAction: 'all' ,typeAhead: true ,width: 275 ,mode: 'local' ,displayField: 'label' ,valueField: 'label' ,style: 'align:center' ,labelStyle: 'width:5' ,store: new Ext.data.ArrayStore(
    { fields: ['label'] ,data: [['Random String Value 1'],['Random String Value 2']] }
    )
    })
    Thanks,
    Jay

  2. #2
    Ext User
    Join Date
    Sep 2010
    Location
    Baltimore, MD
    Posts
    66

    Default

    have you tried playing around with the beforequery event? It may work to add a listener to this event, and then overwrite the queryEvent.query string. You should be able to add a regular expression or wildcard. This should work for local stores.

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    You should read this (which inspired this feature request).

  4. #4
    Ext User
    Join Date
    Sep 2010
    Location
    Canada
    Posts
    12

    Default

    Quote Originally Posted by Condor View Post
    You should read this (which inspired this feature request).
    Thanks Condor! Works like a charm. Also, thank you Foster.

Similar Threads

  1. combobox typeahead search not only the beginning of string
    By neves in forum Ext 2.x: Help & Discussion
    Replies: 19
    Last Post: 13 Apr 2010, 9:39 AM
  2. [Solution] Highlight search string in combobox
    By balmac in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 4 Apr 2010, 9:14 AM
  3. How to search and highlight String in page with DomQuery?
    By seymores in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 5 Aug 2008, 10:57 PM
  4. Replies: 6
    Last Post: 4 Dec 2007, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •