Hybrid View

  1. #1
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    8
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default Store and multiple filters

    Hi,

    i have a Ext.Store with static data. To filter with one param is no problem, but how can I apply multiple filters?
    In API Store.filter is defined as (filter,value) so i don't no how to apply more like
    company:ba,city:be etc.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  2. #2
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    510
    Vote Rating
    5
    MaximGB is on a distinguished road

      0  

    Default

    Why not to use Store::filterBy()?
    Use the force - read the source.

  3. #3
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    8
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default

    Hi,

    i would like to, but i don't know how to use. In Doku it's only declared by function with 2 args.
    What have i to do - validate each record and return true or false?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,568
    Vote Rating
    55
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default

    http://extjs.com/deploy/ext/docs/out....html#filterBy

    Yes, the documentation is totally clear:

    2 params:

    Parameters:

    * fn : Function
    The function to be called, it will receive 2 args (record, id)
    * scope : Object
    (optional) The scope of the function (defaults to this)

    Filter by a function. The specified function will be called with each record in this data source. If the function returns true the record is included, otherwise it is filtered.

    Where's the problem?

  5. #5
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    8
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default

    The specified function will be called with each record in this data source. If the function returns true the record is included, otherwise it is filtered.
    This was the point what was not clear, now i know, thx animal.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,568
    Vote Rating
    55
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default

    That's a direct quote from the documentation.