I'm actually trying to sort the Recordset but not display this in the DataGrid component (something going on behind the scenes) Trouble is, when I use sortItemsBy() refers to the same object and doesn't make a copy. Most times a good thing, but not this time. I want a seperate copy of the RecordSet to be used elsewhere. I have tried my good ol' copyObject function but this fails on a RecordSet for some reason:
function copyObj(o:Object) {
var _o = new o.__proto__["constructor"]();
for (var v in o) {
_o[v] = typeof (o[v]) != "object" ? o[v] : copyObj(o[v]);
}
return _o;
}
It returns undefined. I guess I could just iterate the items array and save them to a different array but that seem long winded. Any ideas?