1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Kraków
    Posts
    8
    Vote Rating
    1
    PavlaQ is on a distinguished road

      0  

    Default Answered: Assocative array problem

    Answered: Assocative array problem


    Hi, I've got a problem with assocative array. I want create dynamically assocative array with dynamic creating / removing elements. My code is:

    Code:
    var tab = new Array();
    
    //create element
    Ext.Array.insert(tab, 0, {
     'db': 'aaa',
     'dbit': 'aaa'
    });
    
    //remove element
     Ext.Array.erase(tab, index, 1);
    Why this code don't working? How I can do this correct?

  2. Hi,

    you can use following code, you have to pass items array instead of object like below:

    Code:
    var tab = new Array();
    
    //create element
    Ext.Array.insert(tab, 0,[['xyz'],['A'],['B']]);
    //remove element
     Ext.Array.erase(tab, 0, 1);
    
    alert(tab);
    check this link :http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Array-method-insert
    see this link also for example :http://jsfiddle.net/RCFwe/3/

  3. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,

    you can use following code, you have to pass items array instead of object like below:

    Code:
    var tab = new Array();
    
    //create element
    Ext.Array.insert(tab, 0,[['xyz'],['A'],['B']]);
    //remove element
     Ext.Array.erase(tab, 0, 1);
    
    alert(tab);
    check this link :http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Array-method-insert
    see this link also for example :http://jsfiddle.net/RCFwe/3/
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Kraków
    Posts
    8
    Vote Rating
    1
    PavlaQ is on a distinguished road

      0  

    Default


    Thank you!
    But I need use own index names for elements. I'm trying this method but again I do it wrong ;/

    Code:
    var tab = new Array();
    
    //create element
    Ext.Array.insert(tab, 0,[['xyz'],['A'],'test' : ['testtesttest']]);
    //remove element
    Ext.Array.erase(tab, 0, 1);
    
    alert(tab);

Thread Participants: 1

Tags for this Thread

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