1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    vtu is on a distinguished road

      0  

    Default Answered: How to filter nested data?

    Answered: How to filter nested data?


    Hi I have nested data loaded into my store using hasMany association. I'm having an issue trying to filter the data. When I look at the main store I noticed my hasMany associations have there own stores inside my main store. I've tried filtering my main store but the record it returns just contains the stores for my associations. So I tried filtering on my association stores but nothing happens. I tried someStore.getData().items[0].thatStore.filterBy(), and just printing out the record but nothing happens. When I print out the association stores they contain the relevant data I'm just not sure how to filter it.

  2. When you have associations, the data no longer belongs to the record, it is then kept in it's own store that is cached on the record. You will not be able to filter the main store for associated data. You would have to loop through each record and filter each store.

    Are you using a DataView/List to display the main data including the associated data?

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Answers
    3354
    Vote Rating
    747
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    When you have associations, the data no longer belongs to the record, it is then kept in it's own store that is cached on the record. You will not be able to filter the main store for associated data. You would have to loop through each record and filter each store.

    Are you using a DataView/List to display the main data including the associated data?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    vtu is on a distinguished road

      0  

    Default


    Thanks for the response I realized it after awhile. I tried using the filter and filterby on the stores inside my main store but it didn't work so I just did my only filter by looping through all the data.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar