Results 1 to 3 of 3

Thread: Get List of records from my store

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
      0  

    Default

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

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
  •