Search code examples
regexextjsextjs-stores

Find records in a Extjs Store for which displayValue starts with a specific substring


I am trying to fetch records from ExtJS store which start with specific substring.

e.g. If I have a country store and if I have a string 'IN' then I want records of India and Indonesia from store.

Is there any way to do this?

Thanks


Solution

  • I suppose this is about a combobox, so that's the default behavior.

    For example: https://fiddle.sencha.com/#fiddle/11r4


    If you just want to filter a store, look at:

    • filters config - Array of Filters for this store.

    • filter method - Filters the data in the Store by one or more fields.

    • filterBy method - Filters by a function.
    • Ext.util.Filter - Represents a filter that can be applied to a MixedCollection.