-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
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
Thank you !,
I've done what you say and it works perfect .
A greeting.
Asked: 2015-05-19 07:19:16 +0800
Seen: 23 times
Last updated: May 29 '15
Large Tree with dynamic columns
Tree width lost after changing col width on maximized panel
MVVM tree example to show add/insert/delete/move/drag?
Error writing 'checked' on type org.zkoss.zul.Checkbox [closed]
Problem with changing MVVM tree model
zk framework: how to load zul pages from WEB-INF under directory zul