W
W
walder2018-08-29 11:12:47
Yii
walder, 2018-08-29 11:12:47

Is it possible to make a tree in a table?

Hello.
I have a table in db
id
productNr
productPartNr
partNr
cost
status
i am currently displaying this table through a simple GridView like this:
id | productNr | productPartNr | partNr | cost | status
and would like to show the whole thing as a tree:

----------------------------------------
|                 | id | cost | status |
----------------------------------------
|+ productNr1     | 1  |  10  |    +   |
----------------------------------------
|-+ productPartNr1| 2  |  5   |    -   |
----------------------------------------
|--- partNr1      | 3  |  2   |    +   |
----------------------------------------

Is it possible to do this and in which direction should I look?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Bukharev, 2018-08-29
@evgenybuckharev

You need to decide what type of tree the task requires, there are several of them.
As a variant of NestedSet, there are also Yii widgets for output under this case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question