1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Vote Rating
    0
    Answers
    4
    izak18 is on a distinguished road

      0  

    Default Answered: Get List of records from my store

    Answered: Get List of records from my store


    Hi everbody, I have a question, How I can get a list of records filter by the function "filter" in my store?

    Something like this:

    1.png

    Code:
    var mat = 10
    
    var newStore = repartoStore.findRecord('matPosicion', mat); (only returns the first match, is not my case, I want a list)
    
    var newStore = repartoStore.data.filter('matPosicion',mat); (return items[0])
    Hope you can help me.
    Thanks in advance!

  2. Are you wanting to change what data is in the store? If so then you can use filter but if not then I wouldn't use filter. I would iterate through the store and add records to an array..

    Code:
    var arr = [];
    
    store.each(function(rec) {
        if (something here) {
            arr.push(rec);
        }
    });

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    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


    Are you wanting to change what data is in the store? If so then you can use filter but if not then I wouldn't use filter. I would iterate through the store and add records to an array..

    Code:
    var arr = [];
    
    store.each(function(rec) {
        if (something here) {
            arr.push(rec);
        }
    });
    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
    Mar 2012
    Posts
    104
    Vote Rating
    0
    Answers
    4
    izak18 is on a distinguished road

      0  

    Default


    Man, you'r the best, thank you so much for your help.

Thread Participants: 1

Tags for this Thread