cancel
Showing results for 
Search instead for 
Did you mean: 

how to create Tree Structure for given data?

Former Member
0 Kudos

Hi,

I have to create a tree structure of Folders and the contents in the Folder.

I have a XML, it contains data for the tree structure to display. How can I create a tree structure which would look like below

Parent
   Child
     Supporting Views
        Raw eInfotree Table Views
        Background Calculations
        QC Data Views
     Calculation Views
     Unit Operation Views
        Cell Culture Views
        Purification Views
        MFR Views
     Personal Views

All the nodes should have folder Icon.

Please find the XML as

<?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2007-05-02T07:37:37" EndDate="2007-05-02T16:59:53" StartDate="2007-05-02T16:59:53" Version="11.5.3"><Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="TK" SQLDataType="4" SourceColumn="TK"/><Column Description="" MaxRange="1" MinRange="0" Name="NAME" SQLDataType="1" SourceColumn="NAME"/><Column Description="" MaxRange="1" MinRange="0" Name="TYPE" SQLDataType="1" SourceColumn="TYPE"/><Column Description="" MaxRange="1" MinRange="0" Name="PK" SQLDataType="4" SourceColumn="PK"/></Columns>
<Row><TK>1</TK><NAME>Parent</NAME><TYPE>F</TYPE><PK>0</PK></Row>
<Row><TK>2</TK><NAME>Child</NAME><TYPE>F</TYPE><PK>1</PK></Row>
<Row><TK>3</TK><NAME>Supporting Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
<Row><TK>4</TK><NAME>Raw eInfotree Table Views</NAME><TYPE>F</TYPE><PK>3</PK></Row>
<Row><TK>5</TK><NAME>Background Calculations</NAME><TYPE>F</TYPE><PK>3</PK></Row>
<Row><TK>6</TK><NAME>QC Data Views</NAME><TYPE>F</TYPE><PK>3</PK></Row>
<Row><TK>7</TK><NAME>Calculation Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
<Row><TK>8</TK><NAME>Unit Operation Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
<Row><TK>9</TK><NAME>Cell Culture Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
<Row><TK>10</TK><NAME>Purification Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
<Row><TK>11</TK><NAME>MFR Views</NAME><TYPE>F</TYPE><PK>8</PK></Row>
<Row><TK>12</TK><NAME>Personal Views</NAME><TYPE>F</TYPE><PK>2</PK></Row>
</Rowset>
</Rowsets>

Accepted Solutions (0)

Answers (3)

Answers (3)

jcgood25
Active Contributor
0 Kudos

Vishal,

How is this effort going - have you been able to implement the desired solution?

Regards,

Jeremy

former_member453678
Participant
0 Kudos

Hi all,

Below is my Query result on which i need to ask a question.

    

The above table is named as "Material".

I want to create a tree-node type structure like this

Material

     |

     Plastic

     Lead

     Colour

     Water

     Wood

     Aluminium

I am using iBrowser for this.

But i am receiving different structure like this -

Plastic

Lead

Colour

Water

Wood

Aluminium

How do i put material on the top as a Parent node and all these Material name as its child nodes.

Please reply ASAP!

Thanks and Regards

Anish Vyas

swaroop_anasane
Active Contributor
0 Kudos

Hi Anis,

There would be a slight change on the dataset you are using. You need to group the data with respect to your parent element.

Then select the child first for mapping and then the parent.

Hope this helps!!

This way it will help achieve a solution for Vishal as well.

Warm Regards,

Swaroop

former_member453678
Participant
0 Kudos

Hi Swaroop

Thankyou for your help. I made a few changes in the query and mapped the parent and child and got the result.

Can you suggest any method by which i can create a three-level tree?

Thanks & Regards

Anish Vyas

swaroop_anasane
Active Contributor
0 Kudos

H Anish,

For this you can use css. Google it there are some open source snippets available. I would get back to you on iBrowser.

Warm Regards,

Swaroop

jcgood25
Active Contributor
0 Kudos

Vishal,

If you structure your data with two columns, the first being the Node name and the second being the Parent node name (see your information below), the iBrowser applet will make a nice data driven tree with all of the SelectionEvent or navigational capabilities you want.

<?xml version="1.0" encoding="UTF-8"?>

<Rowsets DateCreated="2007-05-02T07:37:37" EndDate="2007-05-02T16:59:53" StartDate="2007-05-02T16:59:53" Version="11.5.3">

<Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="NAME" SQLDataType="1" SourceColumn="NAME"/><Column Description="" MaxRange="1" MinRange="0" Name="PARENT" SQLDataType="1" SourceColumn="PARENT"/></Columns>

<Row><NAME>Parent</NAME><PARENT></PARENT></Row>

<Row><NAME>Child</NAME><PARENT>Parent</PARENT></Row>

<Row><NAME>Supporting Views</NAME><PARENT>Child</PARENT></Row>

<Row><NAME>Calculation Views</NAME><PARENT>Child</PARENT></Row>

<Row><NAME>Unit Operation Views</NAME><PARENT>Child</PARENT></Row>

<Row><NAME>Personal Views</NAME><PARENT>Child</PARENT></Row>

<Row><NAME>Raw eInfotree Table Views</NAME><PARENT>Supporting Views</PARENT></Row>

<Row><NAME>Background Calculations</NAME><PARENT>Supporting Views</PARENT></Row>

<Row><NAME>QC Data Views</NAME><PARENT>Supporting Views</PARENT></Row>

<Row><NAME>Cell Culture Views</NAME><PARENT>Unit Operation Views</PARENT></Row>

<Row><NAME>Purification Views</NAME><PARENT>Unit Operation Views</PARENT></Row>

<Row><NAME>MFR Views</NAME><PARENT>Unit Operation Views</PARENT></Row>

</Rowset>

</Rowsets>

Regards,

Jeremy

Former Member
0 Kudos

Hi Vishal,

Follow this java Script and paste it in your HTML page.

FOr more understanding check this link

http://www.softcomplex.com/products/tigra_tree_menu/docs/

Tree Menu hierarchy is JavaScript structure that describes the content of navigation component, all its items and their links. Normally tree hierarchy resides in separate file: tree_item.js.

Items variable is associative array with list of root items. Each item is array itself containing one or more elements. Those elements are:

0 - Caption (required)

1 - Link (optional)

2+ - Child items (optional)

Below find example structure and the tree menu it creates:

var TREE_ITEMS = [

['Home', '/',

['Services', '/services.html'],

['Download', '/download.html'],

['Order', '/order.html'],

['Support', '/support.html'],

],

['Level 0 Item 1', null,

['Level 1 Item 0', 'another.html'],

['Level 1 Item 1', 0,

['Level 2 Item 0'],

['Level 2 Item 1', 0],

],

['Level 1 Item 2'],

['Level 1 Item 3'],

]

];

Best Regards

Ramshanker Upadhyay