For processing JSON object lists I'm using the new Mootools Hash:
http://docs12b.mootools.net/Native/Hash
http://mootools.net/download/tags/1-2b2 (select only "native: hash")
But there seems to be a conflict with Appcelerator, since the
Hash.each() method not only lists the object list itself, but also all
the Hash methods. Try this:
<app:script>
var persons = new Hash([{firstname:'john',name:'doe'},
{firstname:'mary',name:'may'}]);
persons.each( function(value, key) {
Logger.info(key + " " + value);
});
</app:script>
And you get this:
0 [object Object]
1 [object Object]
eachSlice function (D, C, B) { C = C ? C.bind(B) : Prototype.K; var A
= - D, E = [], F = this.toArray(); while ((A += D) < F.length)
{ E.push(F.slice(A, A + D)); } return E.collect(C, B); }
all function (C, B) { C = C ? C.bind(B) : Prototype.K; var A = true;
this.each(function (E, D) {A = A && !!C(E, D);if (!A) {throw
$break;}}); return A; }
any function (C, B) { C = C ? C.bind(B) : Prototype.K; var A = false;
this.each(function (E, D) {if (A = !!C(E, D)) {throw $break;}});
return A; }
...