1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    31
    Vote Rating
    0
    Answers
    1
    korndeang is on a distinguished road

      0  

    Default Answered: How to get data from Store? (Extjs 4+)

    Answered: How to get data from Store? (Extjs 4+)


    Dear all,
    I facing problem with get store data.
    I have create AccountStore and AccountModel class, in AccountStore i used proxy return json data successed.
    I would like get data from my store here my sample code
    Code:
    newstore = Ext.getStore('AccountStore');
            console.log(newstore);
    The result will display as image.
    if i want fireld_key
    So i must use
    Code:
    newstore.data.items[any index].raw.fied_key
    ? Or any good trick then this?
    I am new in Extjs i am worried by using above is wrong Extjs recommended.

    Thanks
    Korndeang

    Store_Raw.png

  2. If you want the field_key you have to itterate to your store(each()), or use the findRecord()

    If you have the record you can use: record.get('field_key') for getting the value =)

  3. #2
    Sencha User Arg0n's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    122
    Vote Rating
    16
    Answers
    12
    Arg0n will become famous soon enough Arg0n will become famous soon enough

      1  

    Default


    If you want the field_key you have to itterate to your store(each()), or use the findRecord()

    If you have the record you can use: record.get('field_key') for getting the value =)

  4. #3
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,783
    Vote Rating
    112
    Answers
    33
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Check out the docs for Store and Model (make sure you've added fields in your model first):

    http://docs.sencha.com/extjs/4.1.3/#...Ext.data.Store

    Code:
    newstore.get([any index]).get('your_field_name')

Thread Participants: 2