An example of Ray was for CF10 beta. See comment . In the CF10 + release, the comparator should return 1, 0, or -1 .
Use this. When executed, a.name > b.nameit simply returns true/ false. You need to return 1/ -1.
<cfscript>
qryTest = QueryNew("ID,Name");
qryTest.AddRow([
{id=1,name="One"},
{id=2,name="Two"},
{id=3,name="Three"},
{id=4,name="Four"}
]);
qryTest.sort(function(a, b) {
return a.name > b.name ? 1 : -1;
});
writedump(qryTest);
</cfscript>

source
share