Skip to Content

Tree Table Binding from normal Json

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"}]}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

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

    Hi

    Does this help?

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

    Thanks

    -D

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2017 at 07:47 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 14, 2017 at 09:30 PM

    HI Shekar

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

    Thanks

    -D

    Add comment
    10|10000 characters needed characters exceeded