0

Prevent text wrapping within treecell

asked 2008-12-13 16:09:11 +0800

sparqle gravatar image sparqle
15

I have copied and pasted the code from ZK demo for the Tree example. I don't want the text to wrap within a tree, at the same time I don't want to truncate the text without the ability to display the whole text if the user resizes the column. How can this be accomplished?
In the example below, you will see that the first treecell wraps the text - how can we prevent ZK from wrapping it, while displaying the text that can fit into the treecell (and displaying more if the column is resized and expanded)

Example:*************************************
<hbox width="100%">
<vbox>
Four style of trees :
<radiogroup
onCheck='tree.setZclass("z-"+self.selectedItem.value)'>
<vbox>
<radio label="Default" value="tree" selected="true"/>
<radio label="Dot Tree" value="dottree" />
<radio label="XP Explorer" value="filetree" />
<radio label="Vista Explorer" value="vfiletree" />
</vbox>
</radiogroup>
</vbox>
<tree id="tree" width="400px" rows="8">
<treecols sizable="true">
<treecol label="Name" />
<treecol label="Description" />
</treecols>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 1 - THIS ONE HAS A REALLY REALLY LONG DESCRIPTION" />
<treecell label="Item 1 description" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2" />
<treecell label="Item 2 description" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.1" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.1.1" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.1.2" />
</treerow>
</treeitem>
</treechildren>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.2" />
<treecell
label="Item 2.2 is something who cares" />
</treerow>
</treeitem>
</treechildren>
</treeitem>
<treeitem label="Item 3" />
</treechildren>
</tree>
</hbox>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-12-29 06:53:45 +0800

jyluo gravatar image jyluo
147 1 1

updated 2008-12-29 06:54:26 +0800

Sorry for the duplicated posting.

link publish delete flag offensive edit

answered 2008-12-29 06:53:37 +0800

jyluo gravatar image jyluo
147 1 1

Is it possible to give every treecell a fixed width in pixel to prevent text wrapping? In addition, how to show the scroll bar for the tree if text in a tree cell does not wrap? Thanks!

link publish delete flag offensive edit

answered 2008-12-17 07:51:15 +0800

PeterKuo gravatar image PeterKuo
481 2

At first glance, I try to solve the problem by set style property.
But word-wrap, text-wrap is CSS 3 only.
Firefox 3 not support CSS 3 yet. Firefox 3 support CSS 2.
Other browser has same situation.
Therefore, the problem can't be easily solved by now.
Please post it to feature request.

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

RSS

Stats

Asked: 2008-12-13 16:09:11 +0800

Seen: 611 times

Last updated: Dec 17 '08

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