Title:
CFCLIENT: structSort doesnt work as expected when sorting is done on nested struct keys
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): / ext-user (Anuj Nawani)
Created: 04/09/2014
Components: Mobile Support, Data Structure
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: 289685 /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Windows 7 64-bit
Vote Count: 0
<div id="actual_3" class="actual">
<cfscript>
employees = structNew();
for ( i=1; i lt 7; i=i+1 )
{
salary = 1200 - i*100 ;
emp = structNew() ;
emp["salary"] = salary ;
employees["emp#i#"] = emp ;
}
</cfscript>
<CFSET res = employees.sort( "numeric", "asc", "salary")>
<CFLOOP INDEX="X" FROM=1 TO="#arrayLen(res)#">
<cfoutput>#res[X]#(#employees[res[X]].salary#)</cfoutput>
</CFLOOP>
</div>
Expected: Should get sorted on basis of salary : o/p should be - emp6(600) emp5(700) emp4(800) emp3(900) emp2(1000) emp1(1100)
Actual: Does not sorts : o/p is - emp1(1100)emp2(1000)emp3(900)emp4(800)emp5(700)emp6(600)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3739782
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: