There is a database with information about network nodes. Some nodes have child nodes, and those in turn may still have children.

A table with all network nodes displayed looks like this:

enter image description here

In the first column, the node itself, in the second, its child node.

It is necessary to make it so that when you click on the main node, the tree of its child nodes opens, and if the children also have children, then when you click on them, more trees will open.

The database looks like this:

enter image description here

That is, a single node can have many children.

Please help me with advice and direction, where to start and how to implement it correctly in general.

  • 2
    When you receive the next node, you actually need to get all the records with the given main_unit and that there would be information in the same record that there are children (a subquery in the select list of the main query). And then when you click on the deployment of a node via ajax, you call the same function, which already for the child element gets what it includes - Mike
  • 2
    Once did something similar, used this plugin jstree.com It may come in handy - koks_rs

0