-
12 Nov 2012 1:23 AM #1
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:
Why this code don't working? How I can do this correct?Code:var tab = new Array(); //create element Ext.Array.insert(tab, 0, { 'db': 'aaa', 'dbit': 'aaa' }); //remove element Ext.Array.erase(tab, index, 1);
-
Best Answer Posted by sword-it
Hi,
you can use following code, you have to pass items array instead of object like below:
check this link :http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Array-method-insertCode:var tab = new Array(); //create element Ext.Array.insert(tab, 0,[['xyz'],['A'],['B']]); //remove element Ext.Array.erase(tab, 0, 1); alert(tab);
see this link also for example :http://jsfiddle.net/RCFwe/3/
-
12 Nov 2012 2:31 AM #2Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
Hi,
you can use following code, you have to pass items array instead of object like below:
check this link :http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Array-method-insertCode:var tab = new Array(); //create element Ext.Array.insert(tab, 0,[['xyz'],['A'],['B']]); //remove element Ext.Array.erase(tab, 0, 1); alert(tab);
see this link also for example :http://jsfiddle.net/RCFwe/3/sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
12 Nov 2012 2:50 AM #3
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);


Reply With Quote