PDA

View Full Version : fetching from MixedCollection



raj_plays
17 Nov 2010, 8:25 AM
I expected the following code to alert all the array elements for the 2 keys
but it gives an error "value[..].y is undefined"
What is wrong?


var dataMap = new Ext.util.MixedCollection();
dataMap.add('KIXI-AM', [{x: 0, y: 1}, {x: 1, y: 1}])
dataMap.add('KQMV', [{x: 1, y: 1}])


for(i=0;i<dataMap.keys.length;i++)
{
//alert(dataMap.keys[i]);
value = dataMap.key(dataMap.keys[i]);
for(j=0;j<value.length;j++)
alert(value[j].x); alert(value[j].y);
}

laurentParis
17 Nov 2010, 8:36 AM
for me it's ok... I paste your code on my console, and I have no error !

raj_plays
17 Nov 2010, 1:41 PM
Thank you, laurentParis.
Probaby some other included js script is messing things up.