Set treeitem styles using the controller

asked 2015-05-19 07:19:16 +0800

josefsabater gravatar image josefsabater
17 4

updated 2015-05-19 07:23:27 +0800


I want to generate a tree in ZK have some elements in bold , but I can not put in bold the text of one treeitem element . The following lines of code do not work:

final Tree tree = new Tree();
final Treechildren treechildren = new Treechildren();

final Treeitem treeitem = new Treeitem();
treeitem.setLabel("Tree 1");
treeitem.setStyle("font-weight: bold"); // not work
treeitem.setZclass("classBold"); // not work
treeitem.setSclass("classBold"); // not work
treeitem.setClass("classBold"); // not work


Please , does anyone know how to add a "class " of an element treeitem ?

Thank you.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-28 09:38:19 +0800

Darksu gravatar image Darksu
1991 1 4

Hello josefsabater,

You have to set the styling to the treecell as shown below:

<window title="tree demo" border="normal" width="400px">
    <tree id="tree" width="90%">
        <treecols sizable="true">
            <treecol label="Name" />
            <treecol label="Description" />
                    <treecell label="Item -- Name" style="font-weight: bold"/>
                    <treecell label="Item -- Description"/>

Best Regards,


link publish delete flag offensive edit

answered 2015-05-29 14:02:37 +0800

josefsabater gravatar image josefsabater
17 4

Thank you !,

I've done what you say and it works perfect .

A greeting.

link publish delete flag offensive edit
Your answer
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

1 follower



Asked: 2015-05-19 07:19:16 +0800

Seen: 22 times

Last updated: May 29 '15

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