Ordering Tree Nodes With RestDataSource

So I have a tree bound to a RestDataSource that loads on demand and utilizes a flat structure (each record has a primaryKey as well as a parent definition defined). I need to be able to reorder the nodes including within their existing folder so I added an ‘idx’ field to the data that tracks this order and is zero based. When I drag the node around and call update it makes it to the server and I perform the update as needed, but alas the change in ordering is not reflected in the tree. I am returning one record with the updated ‘idx’ value, should I be returning the other children with their changed ‘idx’ values as well since they may have changed as the node moves up and down the order. I’ve tried turning on sorting, which does display their order properly at page load, but it does not solve this problem. That may be convoluted and hard to understand, but perhaps it’s a start…

Hi slip5ham,

You are actually allowed to return multiple updated records to cause cache sync to affect multiple records. However it kind of sounds like you could just update these values directly by iterating over the Tree? The Tree is also a List, and List APIs called on the Tree will return currently visible nodes in appearance order.