Raja
Raja

Reputation: 493

Sorting in hierarchy data in javaScript

I have populate the hierarchy data in the following structure.

Screen shot:

enter image description here

In this i want to perform the sorting. In this case i have the flat data object for rendereing. For Expample. I have rendering object as like

renderedobjects=[ {1,...},{2,....} ...];

And also i have tried with sorting by looping the renderedobject and each object have Level property . but it take more time to perform rearrange the rendered objects . Is there any other way to perform this sorting.

Update Screen shots: Screen shot 1: enter image description here

Screen shot 2: enter image description here

Screen shot 3: enter image description here

Update: Hi if it is possible please share the algorithm for perform hierarchial data sorting based on the indent level using recursive functions

Upvotes: 0

Views: 644

Answers (1)

Murali Mopuru
Murali Mopuru

Reputation: 6570

I have implemented TreeGrid by using a YUI example given below. Its pretty easy and has nice JSON pattern for data object.

http://jafl.github.io/yui2/treeble/

Hope this helps.

Upvotes: 1

Related Questions