0

Grid Column Header and Row Alignment?

asked 2006-02-06 16:22:46 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3560478

By: nobody

Greetings,

Am coding up a grid object and adding rows. However, newly added rows do not have the same width as the column headers. How do I set it up so that the field width of each row is the same width as each column header?

Example Code:

<window title="Test Grid">
<grid id="grid" width="500px" height="100px">
<columns>
<column label="und" align="center"/>
<column label="stk" align="center"/>
<column label="exp" align="center"/>
</columns>
<rows>
<row></row>
</rows>
</grid>
<button label="Add row" onClick="addRow()"/>
<zscript>
void addRow() {
Row r = new Row();
new Label("A31").setParent(r);
new Label("A32").setParent(r);
new Label("A33").setParent(r);
grid.getRows().appendChild(r);
}
</zscript>
</window>


delete flag offensive retag edit

17 Replies

Sort by ยป oldest newest

answered 2006-02-07 01:39:40 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3562054

By: henrichen

Hi,

It works ok in IE. Are you using Firefox? It looks like a bug in Grid component implementation when browsing with Firefox. Can you file a bug in bug tracking?
Thanks.

/henri

link publish delete flag offensive edit

answered 2006-03-07 16:56:26 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3616233

By: nobody

I am seeing the same behavior. Yes using Mozilla Firefox 1.5.0.1

link publish delete flag offensive edit

answered 2006-03-08 01:29:50 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3617139

By: tomyeh

The header of grid is calculated based on the first row. In your case, the first row is empty, so ZK client has no idea about the width of each client.

It can be fixed simply by romving <row></row> as follow.

<window title="Test Grid">
<grid id="grid" width="500px" height="100px"> <columns> <column label="und" align="center"/> <column label="stk" align="center"/> <column label="exp" align="center"/> </columns> <rows> </rows> </grid> <button label="Add row" onClick="addRow()"/> <zscript> void addRow() { Row r = new Row(); new Label("A31").setParent(r); new Label("A32").setParent(r); new Label("A33").setParent(r); grid.getRows().appendChild(r); } </zscript> </window>

Jim has posted to Bugs. I'll find a way to fix this issue.

link publish delete flag offensive edit

answered 2006-03-08 14:42:06 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3617961

By: jim_bo_lisa

I downloaded the nightly build and I am seeing now that all the row columns are misaligned in Firefox. Before only one or two were slightly out of alignment.

Here is my Zul code.
<grid height="200px">
<columns>
<column label="Condition" />
<column label="Component" />
<column label="Attribute" />
<column label="Keyword" />
<column label="Edit" />
</columns>
<rows id="_queryBuilderRows" />
</grid>

I then programatically get the id for the rows control, then create a Row and
appenChild() labels to the Row, then finally do a rows.appendChild(myNewRow) using this newly created Row child.

Hope that helps.

link publish delete flag offensive edit

answered 2006-03-09 17:24:36 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620519

By: jim_bo_lisa

Should I submit this as a bug?

link publish delete flag offensive edit

answered 2006-03-09 17:34:00 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620557

By: tomyeh

Is it http://sourceforge.net/tracker/index.php?func=detail&aid=1444981&group_id=
152762&atid=785191?

See also
http://sourceforge.net/tracker/index.php?func=detail&aid=1431351&group_id=152762
&atid=785191

http://sourceforge.net/tracker/index.php?func=detail&aid=1436657&group_id=152762
&atid=785191

In short, misalignment happens if header's text is too long or short comparing to the body's text. And, this is basically browser's limitation. Specifying width explicitly to resolve this case.


link publish delete flag offensive edit

answered 2006-04-21 13:06:30 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3697529

By: nobody

How can I change header data in zul file, because it's automatically generated?

link publish delete flag offensive edit

answered 2006-04-21 13:34:20 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3697575

By: henrichen

When you say header, do you mean the contents between <head> ... </head> in the generated HTML? Why do you need to change it?

/henri


link publish delete flag offensive edit

answered 2006-04-21 15:27:51 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3697721

By: nobody

I want to change charset in meta tags

link publish delete flag offensive edit

answered 2006-04-21 15:37:42 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3697734

By: henrichen

There are only one way then. You have to write zhtml page(default your namespace to xhtml) and use zul namespace as exception. It is a little bit tedious if you use a lot zul components but works ok.

Or maybe you want to post a Feature Request so we can track it.

/henri

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: 2006-02-06 16:22:46 +0800

Seen: 1,025 times

Last updated: Apr 22 '06

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