0

grid columns multiline

asked 2010-03-28 08:00:59 +0800

kal gravatar image kal
21 1 1

Hi all,
Is it possible to turn on word wrap in grid columns? In rows it works fine, but columns dont have multiline attribute, and i have no idea how to insert newline character to column label="...".

My code looks like this:
<zk:grid>
<zk:columns>
<zk:column label="this is a very very long text"/>
<zk:column label="value"/>
</zk:columns>
<zk:rows>
<zk:row>
<zk:label value="1/>
<zk:label value="i have a longer text here too, but its ok because zk wraps the lines">
</zk:row>
...
</zk:rows>
</zk:grid>

My problem, there is a lot of empty space next to the number, and if i set width shorter, the column labels end isn't visible. Is there a way to insert multiline value to column label attribute?

Thanks your answers.

delete flag offensive retag edit

17 Replies

Sort by ยป oldest newest

answered 2011-03-17 01:36:57 +0800

PeterKuo gravatar image PeterKuo
481 2

@niting, you may modify the css like following

<window title="listbox demo" border="normal" width="250px">
<style>
div.z-listbox-header th.z-listheader, div.z-listbox-header th.z-auxheader {
white-space: pre-wrap;
}
</style>
<listbox id="box">
<listhead sizable="true">
<listheader label="name wrap wrap wrap" />
<listheader label="gender" />
</listhead>
<listitem>
<listcell label="Mary" />
<listcell label="FEMALE" />
</listitem>
</listbox>
</window>

link publish delete flag offensive edit

answered 2011-03-17 11:28:41 +0800

niting gravatar image niting
111

Thank you Peter
I have observed that even if the column value wraps. The row value does not. There is an overflow.
In Html have noticed when the column width is set as <td width="4%"> but the value is a single character, the column is auto adjusts to size even if 4% is assigned to it.
Is it possible to achieve the same behaviour for column and row values?
Tried size by content which sized the content by the data in the row.

In my grid I assigned px for column width and the width set is absolute in case of html it seemed relative.

Please let me know in case you need more information.


Thanks
Nitin

link publish delete flag offensive edit

answered 2011-03-22 21:37:37 +0800

PeterKuo gravatar image PeterKuo
481 2

@niting,
I don't catch your requirement.

Do you want the grid column head and row value all wrap the content according to the width?
Or do you want size by content and not wrap it?

Size by content not fulfill your need? Why?

link publish delete flag offensive edit

answered 2011-03-23 09:30:47 +0800

niting gravatar image niting
111

PeterKuo, my apologies for not being clear.

Yes I would want the grid column head and row value all wrap the content to the width.
Also, row value should not word-break or overflow.

With Size by content
1. Have noticed that sizes by the row value and column width becomes redundant
2. Since some of the reports have lot more columns, the report is required to show a compact view with all data (most of the times) visible in one page without scrolling.
3. And have noticed rendering time to increase for large reports.

Please clarify my understanding.Thanks for your help
Nitin

link publish delete flag offensive edit

answered 2011-03-27 22:49:45 +0800

PeterKuo gravatar image PeterKuo
481 2

I tested in firefox, ie, chrome. The value has wrapped both in header and row in the following zul.

<window title="listbox demo" border="normal" width="250px">
<style>
div.z-listbox-header th.z-listheader, div.z-listbox-header th.z-auxheader, div.z-listheader-cnt{
white-space: pre-wrap;
}
</style>
<listbox id="box" width="200px">
<listhead sizable="true">
<listheader label="name wrap wrap wrap" />
<listheader label="gender" />
</listhead>
<listitem>
<listcell label="Mary wrap wrap wrap" />
<listcell label="FEMALE" />
</listitem>
</listbox>
</window>

link publish delete flag offensive edit

answered 2011-04-06 09:57:46 +0800

niting gravatar image niting
111

Hi Peter,

Thank you very much. The wrapping problem is solved.

Have another issue of value overflowing the specified column width. This I have noticed does not happen in html.
i;e if I have a column of width 40 px and have a long word eg: LOngLongLongVeryLongWord this overflows the column width.

I cannot break the word either.

Thanks for your help

-Nitin

link publish delete flag offensive edit

answered 2011-04-12 23:54:12 +0800

PeterKuo gravatar image PeterKuo
481 2

You may try out some css setting about word wrap, break.
http://webdesignerwall.com/tutorials/word-wrap-force-text-to-wrap

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: 2010-03-28 08:00:59 +0800

Seen: 2,853 times

Last updated: Apr 12 '11

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