create hierarchical tree of categories and display tree in select box
Hi,
Hope you are all well !
Is it possible to give an example of how to create a hierarchical tree of categories ?
I tried qor-example and it is not showing the parent category in the select box. It would be really convenient for similar category labels.
Cheers, X
hi @x0rzkov
"categories" you mean in the select_one or select_many component?
Hi @raven-chen ,
thanks for the reply !
This piece of code is not working when you are trying to create a tree of category https://github.com/qor/qor-example/blob/master/models/products/category.go
I tried to re-implement it on a separate qor-admin instance and each time I save a new category with a parent category, it deletes other relationships (for other categories I created).
And from your code, https://github.com/qor/qor-example/blob/master/app/products/products.go#L57, it is select_many component.
Thanks for your next reply, as I need to sort it out quickly either they will kick my ass ^^
Hi guys, @raven-chen
I think that I understand what he means.
Something like that:

Refs:
- https://github.com/griffinqiu/go-nested-set (gorm v2)
- https://github.com/vcraescu/gorm-nested (gorm v1)
That would be awesome to add such panel to browse items/products.
Do you think that the qor dev team can do that easily ?
Thanks for any insights or inputs on that
Cheers, Luc Michalski