First of all, go to my previous post to see how the getRecordField function is defined and used.
Next, let’s see how the advancedDynamicSort function, that we’ll use for array sorting, looks like:
I have to give credit to the original creator of the dynamicSort function, Ege Özcan, and his StackOverflow answer. All I did in the end was adjusting his method to work with my function that dynamically reads object’s properties in order to make the sorter even more flexible.
That’s it, I hope you’ll find this useful, and if you have any suggestions or critique, feel free to drop me a line in the comments below.