Custom Array Sorting? #1013
-
In vanilla javascript arrays can be sorted like this: To make it concrete: I am using Dataview with Longform. Longform has an index of files that determines the order of the files in a manuscript. I can get the ordered collection like so:
It's a different order than, eg, I want my dv collection of
But the I've thought about mapping the ordered_scenes to Dataview page objects, but I don't know if it's possible to do that without breaking all the query and group functionality. Here's what I'm ultimately trying to do:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Use the longform index to generate the DV index? Seems neater that way. If you have the list of paths from long form, you could just |
Beta Was this translation helpful? Give feedback.
-
Thanks @AB1908! I found that custom compare does actually work! Here's some working code for anyone who stumbles on this in the future:
|
Beta Was this translation helpful? Give feedback.
Thanks @AB1908! I found that custom compare does actually work! Here's some working code for anyone who stumbles on this in the future: