0

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

Hello,

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

treechildren.appendChild(treeitem);
treeBusqueda.appendChild(treechildren);

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
0

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" />
        </treecols>
        <treechildren>
            <treeitem>
                <treerow>
                    <treecell label="Item -- Name" style="font-weight: bold"/>
                    <treecell label="Item -- Description"/>
                </treerow>
            </treeitem>
        </treechildren>
    </tree>
 </window>

Best Regards,

Darksu

link publish delete flag offensive edit
0

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

Follow
1 follower

RSS

Stats

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

Seen: 23 times

Last updated: May 29 '15

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