I am stuck on using a custom sort function. What is expected as input?
-
There are two methods I see that accept a custom sort function as a parameter input:
'''
ScriptedViewport.setTableSortFunction(var sortFunction)
'''
and
'''
Engine.sortWithFunction(var arrayToSort, var sortFunction)
'''What format is expected? I am not sure how to use these.
I am currently working with the Viewport which has a table mode.
I am trying to use
'''
ScriptedViewport.setTableSortFunction(var sortFunction)
'''
and in the Docs it says:
"Sets a custom function that can be used in order to sort the table if the user clicks on a column header."I have a snippet here with a sort function, but I can't seem to get it do do anything.
Clicking on the header gives me no feedback and does not seem to trigger anything
(the Console is set to print "Sorting triggered...").HiseSnippet 1162.3ocsV0uaZbDDeOatzBsUpopO.q3eJtkRNv1w108CyG10nFhQAG2FEEEsb2BrwG6htcOSPQ9couI8UpuAsybe.mApsqU68GHlY9M6N6Ly9a1tAJWtVqBHVENe1DNw5Ss6MSZF0bDSHIsaQr9J6y4ZiPNjdgfOchJvPYZ54r99b5.U.sGnArRZLaBSq4dDKqM+YzYq74HQe+4O0f4yjt7EpHjKTBW9yDiElEZ6dzuH78Og4wOWLNC5cNpsqR1T4qBg.cSaGxDl6krg7myPXaXSNkoGQr9ZaW2cNfu+fZ64T6.9td6zuVUGVMmCNXONaWG29GvY0Fz20gX8ni8DFUPOCyv0vh1P4Mq2H0TY7FbgPKfSHJTkzC14X0jliD9dcSyZZBwJW2E4vMiygeocGgmXt9E4xOOx.cgGYSZVabagT0+EgjUlPJWbH8X6dtAhIlEVv34SraKM7fALn1jMThwR13OxY2TAHjlJiYWxOI.Dl6Qom53TlB+r0gEJ.0GsgdEKfhcKwcG+.M04gbSS03IJIHTpXZeT0hnmywWQyi+SGkGuPoOTHewNg9FAT2CGKQkE+N5.lulWFLcJGZSBNkKFNx.52tFp7EpoKoANIJe+yjsBXCScuv0qeeAuawLrBkdcg7enX71RqCdUrYwxzTEM.E6bc4kgzZIHauJj5KAo1pPZrDjp.j2r9nMFkFiVLU0tUTfltV3YGq7nxy4u2DoniP9qBOyHP49NEfkdEGabObrbgqiiom7DZyPsQMlpQVgAgRWiPIKj9GpajUjf3jDUkBTSqWlB+1XKX2ovG1yHg6w0g9Ez5qWbHdSEi5Ypo7flLMuDrkYw2HFei6BezOPinVAIuIABrCLgyhZBDCGxC3dUpTIpYDwJFPKEGPee7FsEMfaBCjzus5gKg3GWBQBfDImCgTEllpq0hgRpYDedVhZTQxWkbYXMU3aj3VMWlTBhuq4x786CjhqqQIwTozstz6zJ4Y8eG20rEMoJrTBxDsnpHLPi.8afTEdkOimv1GcOB9lelTxmqL7yjkvhad3vSW1zfAq0FRTfWT4Aq0LNNH31brjLbbedPYn6vOjOGHP+cSN0Gc+3Tci4sx.TIaKElylvSjOQ46gbk3+WkAljP7gbwIQH.0DwD+EILwbuTdPhvCohmSKRhNDYGVRdYajYJc4fUF1sIbnIFOTVs3WACSiI5ya2hquznlDgMgykX8Q26M+8K13WczrrBSQJ.hks0uChih3YSkvt3tJs.qJuJ6jexpihfgfJuPel4lSFw2LjX.VjaLNBG4HgEeV1Ud4wk49mKsNYJs2Qg6dFtO1tqv3NZ8w6FqIdgR2+2waxiO9L6iGL.tftHXyYexucquz3+lP4EpPjTsCCXUglH6mGBzUgAtbHRjRtuFaV1.ubDK6fxXloGW5EI7WvWhwpnrUhwpoFIiYv7725FekBepyGGoAhIYzSAya2Akoq4NzX3kWu008lK0JNV6g531OTG24g53tOTGe5C0w8dnNt+c6H9v35gvHt3qSDRmtGGw4YYcrDmFE04R9awj9kJC
The tableCallback is printing interactions with the table, but it does not react when the header is clicked.
Has anyone used this feature who could enlighten me on what to do? -
@VirtualVirgin I made a video about sorting arrays that includes an explanation about
sortWithFunction
. I haven't tried table sorting yet so don't have anything to offer there. -
@d-healey Thank you!
I'll watch this in a bit.