I'm having issues when trying to randomize the order of objects in a collection.
Here's the code that I've tried:
console.log(this.collection);
shuffled = this.collection.shuffle();
console.log(shuffled);
And here's the console output (using a test collection with 3 items):
child {models: Array[3], length: 3, _byId: Object, url: "/myurl/myid", _listenerId: "l7"…}
_byId: Object
_events: Object
_idAttr: "id"
_listenerId: "l7"
length: 3
models: Array[3]
__proto__: Surrogate
[child, child, child]
0: child
1: child
2: child
length: 3
__proto__: Array[0]
As you can see, the Collection is not being shuffled properly, instead it's creating a new unuseable object full of pesky children.
All I'm trying to do is randomize the order in which the models appear in the collection before passing it to a view for display (I'm creating a button called "randomize" which needs to randomize the display of the items in the collection). I thought this would be an easy task, but at this point I'm considering just creating a whole new model and doing the shuffle on the server.
Any help is greatly appreciated!