0

How to build a dynamic tree

asked 2014-07-31 12:17:10 +0800

Ericxu gravatar image Ericxu
0

can someone give me a demo?thank you very much.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2014-08-01 23:54:06 +0800

Darksu gravatar image Darksu
1991 1 4

Hello Ericxu,

You can find information on how to build a dynamic tree at the following url:

http://www.zkoss.org/zkdemo/tree/dynamic_tree

Best Regards,

Darksu

link publish delete flag offensive edit

answered 2014-08-05 06:59:31 +0800

xujun738 gravatar image xujun738
1

package demo.data;

import demo.data.pojo.Contact; import demo.tree.dynamic_tree.ContactTreeNode;

public class ContactList { public final static String Category = "Category"; public final static String Contact = "Contact";

private ContactTreeNode root;
public ContactList() {
    root = new ContactTreeNode(null,
        new ContactTreeNode[] {
            new ContactTreeNode(new Contact("Friend"),new ContactTreeNode[] {
                new ContactTreeNode(new Contact("High School"), new ContactTreeNode[] {
                    new ContactTreeNode(new Contact("Fernando Terrell", "Contact.png")),
                    new ContactTreeNode(new Contact("Stanley Larson", "Contact.png"))
                },true),
                new ContactTreeNode(new Contact("University"), new ContactTreeNode[] {
                    new ContactTreeNode(new Contact("Camryn Breanna", "Contact.png")),
                    new ContactTreeNode(new Contact("Juliana Isabela","Contact-gu.png")),
                    new ContactTreeNode(new Contact("Holden Craig", "Contact-g.png"))
                }),
                new ContactTreeNode(new Contact("Emma Jones", "Contact-i.png")),
                new ContactTreeNode(new Contact("Eric Franklin",  "Contact.png")),
                new ContactTreeNode(new Contact("Alfred Wong", "Contact.png")),
                new ContactTreeNode(new Contact("Miguel Soto",  "Contact.png"))
            },true),
            new ContactTreeNode(new Contact("Work"),new ContactTreeNode[] {
                new ContactTreeNode(new Contact("Andrew Willis",  "Contact.png")),
                new ContactTreeNode(new Contact("Russell Thomas",  "Contact-jq.png")),
                new ContactTreeNode(new Contact("Donovan Marcus",  "Contact.png"))
            })
        },true
    );
}
public ContactTreeNode getRoot() {
    return root;
}

} the data is static ,I mean that how can i construct the root element with the data which come from my database.

link publish delete flag offensive edit

answered 2014-08-06 15:00:16 +0800

bridgingloansguru gravatar image bridgingloansguru
1

have been looking for the answer of same question. Thanks for asking

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-07-31 12:17:10 +0800

Seen: 13 times

Last updated: Aug 06 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More