Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
wolfgang  
#1 Posted : Thursday, August 27, 2015 10:56:59 PM(UTC)
wolfgang

Rank: Advanced Member

Groups: Registered
Joined: 6/23/2015(UTC)
Posts: 59
Germany

Thanks: 5 times
Is there a chance to sort a tree internally not using a server request? If so, does any example exist in the docs?
Thanks
bbv  
#2 Posted : Friday, August 28, 2015 10:06:39 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 494

Was thanked: 87 time(s) in 87 post(s)
Yes, it is possible. You can do it with Append Node command by appending sorted nodes to the same tree.

For example, given the tree structure $PERSISTENT/Root/Nodes/@name
in order to sort the Nodes within the Root element, I would use

Append to Node $PERSISTENT/Root
new Nodes for $i in $PERSISTENT/Root/Nodes order by $i/@name return $i
as last Child
[x]remove appended nodes from their current location

By checking the "remove appended nodes" you basically reappend the same sorted nodes and remove the existing ones at the same time.

thanks 1 user thanked bbv for this useful post.
wolfgang on 8/28/2015(UTC)
wolfgang  
#3 Posted : Friday, August 28, 2015 11:21:08 AM(UTC)
wolfgang

Rank: Advanced Member

Groups: Registered
Joined: 6/23/2015(UTC)
Posts: 59
Germany

Thanks: 5 times
Great, thanks for helpful sample!
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.