Implement unlimited classification, but want to display a tree chart. how can this problem be solved?

Source: Internet
Author: User
Unlimited classification is implemented, but tree charts such as root directory & nbsp; | ____ category 1 & nbsp; |-category 1 & nbsp; |-category 2 & nbsp; | ____ category 2 & nbsp; I have implemented the infinite classification by recursive method, but what should I do if I want to display it in the selection box ?, There are a lot of such things on the Internet, which implement unlimited classification, but want to display a tree chart
Such as the root directory
|____ Category 1
|-Class 1
|-Class 2
|____ Category 2
I have implemented the infinite classification method by recursion, but what should I do if I want to display it in the selection box like this?

------ Solution --------------------
There are a lot of such things on the Internet, looking for a lot

Http://www.oschina.net/code/snippet_99943_1452
------ Solution --------------------
PHP code
Foreach ($ result as $ res) {foreach ($ res as $ r) {if ($ r ['id'] = $ res ['id']) echo "|-small ". $ r ['id']."
";} Echo" |--large ". $ r ['id']."
";}
------ Solution --------------------
The same applies to the selection box. Embed the select control.
------ Solution --------------------
First, give the data you have obtained (as long as it is representative, no need for complete data)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.