Results 1 to 3 of 3

Thread: Store filter doesn't seem to work (combobox example)

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Sweden
    Posts
    11
    Vote Rating
    2
      0  

    Default Store filter doesn't seem to work (combobox example)

    Repro: ExtJs 4.2.1, Strict docType
    Browser: Chrome 32.0.1700.107 m, IE11

    Problem: When setting filter on combo store, either numeric or string, the filtered records are not as expected. More exactly, when setting filter on value 2, I get all records with the filter property value 2, but also 20, 200, ... And it doesn't matter if I defined the model fields as int type or leave the default string. It is repro also on custom stores, that are extending Ext.data.Store.

    Steps to repro:
    1. Run fiddle: https://fiddle.sencha.com/#fiddle/3jv
    2. Select from category combo any category
    3. Open the sub category combo and check the filtered values

    The result that was expected:
    1. If I choose Cat 2, I should see only Subcat 2.
    2. If I choose Cat 3, I should see only Subcat 3.

    The result that occurs instead:
    1. If I choose Cat 2, I see Subcat 2 and Subcat 20.
    2. If I choose Cat 3, I see Subcat 3, Subcat 30 and Subcat 300.


    Let me know if you need more info.
    Best regards, Luk

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,711
    Vote Rating
    893
      1  

    Default

    In the current version, the filter defaults to a filter that essentially matches ^value. This is by design.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha User
    Join Date
    May 2012
    Location
    Sweden
    Posts
    11
    Vote Rating
    2
      1  

    Default

    So you mean the only possible workaround is setting filter like this:
    Code:
    subCatStore.filter('category_id', new RegExp('^'+newValue+'$'));
    Ok, thanks, I haven't dig deep enough to find about this...

Tags for this Thread

Posting Permissions

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