Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: How to loop through Store Records?

  1. #11

    Default

    I found the solution in another thread. Problem was the scope of the function:

    http://www.sencha.com/forum/showthre...n-%28scope-%29

  2. #12
    Sencha Premium User NoahK17's Avatar
    Join Date
    Apr 2008
    Location
    Atlanta, GA
    Posts
    538

    Default

    If you're looking to loop through a store in ExtJS 6.x, you can use something like this:

    Code:
    const store = this.getViewModel().getStore('myStore');
    const data = store.data.items;
    Object.keys(data).forEach((needle) => {
       data[needle].set('firstName', 'Noah'); // add a key/value pair to every record
    });
    Noah
    Front-End Developer
    Norfolk Southern

Page 2 of 2 FirstFirst 12

Posting Permissions

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