Hello,
I amd developing an app that uses 2 json datasets(A & B) each with its own separate data source. One of these datasets( B updated every 30 mins) is tied to a spry:region and has a {function::} that gets corresponding data from the other dataset(A updated every 30 secs)( if any as a record item may no have any information/ reference related to it at all). However, should data exists I would like the dataset(B ) records to be sorted based on related record data in the other dataset (A)( if there exists any for it). Can a user defined sort function be made to cater towards this and how?
dataset A has a records
"[{id:1, order:1},'{id:2,order:4},{id:4, order:3}]"
dataset B has records
[{id:1},{id:2},{id:3},{id:4}]
when I list out dataset B I need it to be sorted in an order that is based on its related information( order) in dataset A
thus
in spry:repeat lists out the dataset B in order of ascending based on {order} in dataset A
<ul><li>id = 1</li><li>id = 4</li><li>id = 2</li><li>id = 3</li></ul>
I had thought about including the dataset A in the same region but IT wouldn't help with the sorting and there exists the possiblity that recrods in B would not contain any information in dataset A
Pff... Don't know if it's me or last hours of the day, but I'm having a hard time to get it.
{id: 2, order:4} is in third position in your ordered list, {id:4, order:3} is in 2nd position. I take it that what you call 'order' in dataset A is the **position** in which 'id' belonging to dataset B should be in your resulting HTML ordered list; correct?
As for me, I still need more code such as your Spry regions too...
North America
Europe, Middle East and Africa
Asia Pacific