Objective
I am attempting to create a hierarchical structure that is dynamic within a single .dbf table. Visualize an organization chart that will allow an infinite number of nested nodes and you will have a good idea of what I am attempting to achieve.
At the last node, I wish to input a value. There should be no values at any of the branch nodes, only at the final node. Therefore, once a node has a value, you cannot add another node.
(First Record)
Organization
(Second Record)
Organization
Here is another representation:
categories.png
Possible Solution
I have found two methods to achieve this flexibility. The first is to use the Adjacency List Model; the second is the Nested Set Model. The simpler Adjacency List should work, but I don't know how to create nested levels in either a desktop based browse or a web based grid component. I'm certain that Joe Celko could do this in SQL but how do I show the nested values via GUI in Alpha? My focus is to do this on the web.
Adjacency List Model table design
category_id | name | parent_category_id |
1 | ELECTRONICS | NULL |
2 | TELEVISIONS | 1 |
3 | TUBE | 2 |
4 | LCD | 2 |
5 | PLASMA | 2 |
6 | PORTABLE ELECTRONICS | 1 |
7 | MP3 PLAYERS | 6 |
8 | FLASH | 7 |
9 | CD PLAYERS | 6 |
10 | 2 WAY RADIOS | 6 |
On the web, using the Grid Component Group breaks could work, but only to one (1) level, not N levels. The idea here is to have the depth of each node be variable. For example, There could be one org with only 3 Sub organizations, whereas as second organization could have 3 or more nodes as in the first example.
I apologize for the abstract nature of my post, but know of no better way to ask the question.
I am attempting to create a hierarchical structure that is dynamic within a single .dbf table. Visualize an organization chart that will allow an infinite number of nested nodes and you will have a good idea of what I am attempting to achieve.
At the last node, I wish to input a value. There should be no values at any of the branch nodes, only at the final node. Therefore, once a node has a value, you cannot add another node.
(First Record)
Organization
Sub Organization
Group
Person; Salary _____
(Second Record)
Organization
Sub Organization
Person; Salary _____
Here is another representation:
categories.png
Possible Solution
I have found two methods to achieve this flexibility. The first is to use the Adjacency List Model; the second is the Nested Set Model. The simpler Adjacency List should work, but I don't know how to create nested levels in either a desktop based browse or a web based grid component. I'm certain that Joe Celko could do this in SQL but how do I show the nested values via GUI in Alpha? My focus is to do this on the web.
Adjacency List Model table design
category_id | name | parent_category_id |
1 | ELECTRONICS | NULL |
2 | TELEVISIONS | 1 |
3 | TUBE | 2 |
4 | LCD | 2 |
5 | PLASMA | 2 |
6 | PORTABLE ELECTRONICS | 1 |
7 | MP3 PLAYERS | 6 |
8 | FLASH | 7 |
9 | CD PLAYERS | 6 |
10 | 2 WAY RADIOS | 6 |
On the web, using the Grid Component Group breaks could work, but only to one (1) level, not N levels. The idea here is to have the depth of each node be variable. For example, There could be one org with only 3 Sub organizations, whereas as second organization could have 3 or more nodes as in the first example.
I apologize for the abstract nature of my post, but know of no better way to ask the question.
Comment