Skip to Content
0

Tree Table Binding from normal Json

Mar 14, 2017 at 07:08 AM

86

avatar image

Hi All,

I have a requirement to bind the data to tree table.

I need to fetch the data from hana db and bind to Tree Table.

I am using xsjs service to fetch the data.

Now my issue is how can i bind the json to that tree table

I have an hierarchy like One project has multiple sections and each section has multiple tasks

Could anybody please help me in preparing tree structured JSON.

Below is my json Format which i have.

{"projects":[{"projectName":"Valuefact","section":"Checking For Tables","task":"Causal/Resultent Table"},{"projectName":"Valuefact","section":"Checking For Tables","task":"Material Loss Table"},{"projectName":"Valuefact","section":"Checking For Tables","task":"Machine Loss Table"},{"projectName":"Valuefact","section":"Checking For Procedures","task":"Causal/Resultent"},{"projectName":"Valuefact","section":"Checking For Procedures","task":"Loss Value"},{"projectName":"Splunk","section":"Find Loss Types","task":"Loss Type"},{"projectName":"Splunk","section":"Find Loss Types","task":"Loss Value"},{"projectName":"Splunk","section":"Find Waste Types","task":"Waste Units"},{"projectName":"Splunk","section":"Find Waste Types","task":"Waste Loss Value"},{"projectName":"Pulse","section":"Loss Trends","task":"Loss Trends For Daily"},{"projectName":"Pulse","section":"Loss Trends","task":"Loss Trends For Week"},{"projectName":"Pulse","section":"Amount","task":"Per Month"},{"projectName":"Pulse","section":"Amount","task":"Per Year"}]}
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member
Mar 14, 2017 at 07:35 AM
0

Hi

Does this help?

http://jsbin.com/lecica/edit?html,js,output

Thanks

-D

Share
10 |10000 characters needed characters left characters exceeded
Mantri Shekar Mar 14, 2017 at 07:47 AM
0

Hi Dennis Seah,

Yes this helped me.This is really great.

But again i need one more drill down .Is it possible.

Like for causal resultant i have multiple tasks

Regards,

Shekar.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member
Mar 14, 2017 at 09:30 PM
0

HI Shekar

It is always possible. It is a matter of reorganizing the data in your JSON model.

Thanks

-D

Share
10 |10000 characters needed characters left characters exceeded