1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    61
    Answers
    3
    Vote Rating
    0
    kidqn is on a distinguished road

      0  

    Default Answered: Cannot use getAt() method in initialize function

    Answered: Cannot use getAt() method in initialize function


    I want to show a question with answers in a panel.
    I have a store which stored list of questions as below:
    PHP Code:
    1. Can you help me?
                 
    A.Yes
                 B
    .No
             2. Can you help me
    ?
                 
    A.No
                 B
    .Yes
             3. Can you help me
    ?
                 
    A.Yes
                 B
    .Yes 
    I test in Store.js, create a load: function, it's OK.
    Code:
    load:function(store,record)
    {
                var rec      = store.getAt(1);
                console.log(store)/// CORRECT, array[311]
                console.log(rec); ///it's work, an element in array }
    But in mypanel.js,
    Code:
    initialize:function()
    {          
                var store = Ext.getStore("Listquestion");  
                var rec = store.getAt(0);
                console.log(store)/// CORRECT, array[311]
                console.log(rec); ///// text output: undefined
                console.log(store.getCount()); ///text output: 0
                this.callParent(arguments); 
        },
    Can you help me solve this problem? I think the key is load:function

  2. Thank you! Sorry I found the error is load event of store.
    store.on("load", function(s,rs) {//It's OK}

  3. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,860
    Answers
    325
    Vote Rating
    126
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    What does the code for your store look like?

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    61
    Answers
    3
    Vote Rating
    0
    kidqn is on a distinguished road

      0  

    Default


    Thank you! Sorry I found the error is load event of store.
    store.on("load", function(s,rs) {//It's OK}

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi