0

forceing components to a specific height

asked 2012-10-09 21:00:41 +0800

kbsimm gravatar image kbsimm
153
http://www.ArivX.com/

Using GenericiRichlet (java programing not zul scripting) I have a situation where I have a Grid with a custom model and custom renderer. The custom renderer builds each cell for each row. I need to force each row to be exactly "15px" in height. In some cases data within a cell will be partially obscured because the height does not allow full display. A tooltiptext will show the entire data on mouse over.

I have tried cell.setHeight and Row.setHeight but that has not worked.

thank you for your assistance.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-10-10 17:52:29 +0800

kbsimm gravatar image kbsimm
153
http://www.ArivX.com/

Here is an example.... using ZK fiddle http://zkfiddle.org/sample/576mri/1-Monthly-Time-sheet-of-Balance-with-Grid after line 7 add

row.setHeight("50px")

You will see that the rows are all 50px in height. Without setHeight they were all about 33px.

Now change that line to

row.setHeight("20px")

They still come out about 33px.

Can someone tell me what the process is for ZK to determine a rows final height?

link publish delete flag offensive edit

answered 2012-10-10 21:21:24 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

You need to modify the css. Try this code:

   . . .
	<grid id="monthlySheet" width="600px" sclass="GridPlain">
		<columns>
			<column width="80px" >Year</column>
			<column width="80px" >Month</column>
			<column width="80px" >Date</column>
			<column width="80px" >Weekday</column>
			<column width="80px" >In</column>
			<column width="80px" >Out</column>
			<column width="80px" >Balance</column>
		</columns>
	</grid>

  <style>
    .GridPlain tr.z-row td.z-row-inner,.GridPlain tr.z-row .z-cell,div.z-grid.GridPlain,.GridPlain tr.z-grid-odd td.z-row-inner,.GridPlain tr.z-grid-odd .z-cell,.GridPlain tr.z-grid-odd,.GridPlain tr.z-row-over>td.z-row-inner
	{
	border: none;
	zoom: 1;
	background: white none repeat scroll 0 0;
	border-top: none;
	border-top-style: none;
	border-top-width: 0px;
	padding-top: 0px;
	padding-left: 3px;
	padding-right: 3px;
	padding-bottom: 0px;
	border-left: none;
	border-right: none;
	border-bottom: none;
	border-bottom-style: none;
	border-bottom-width: 0px;
}
  </style>
   . . .

best
Stephan

link publish delete flag offensive edit

answered 2012-10-11 02:30:25 +0800

kbsimm gravatar image kbsimm
153
http://www.ArivX.com/

Stephan,

thank you for the help.
The code you provided did not seem to work. I am not a CSS expert by any means but I don't see where you are setting the row height. And the .GridPlan class definition does not seem to be well formed. There seems to be a stray left bracket

Can you double check it and ensure their was not a pasting error.

thank you

link publish delete flag offensive edit

answered 2012-11-06 23:24:28 +0800

kbsimm gravatar image kbsimm
153
http://www.ArivX.com/

I was able to solve this:

The key is to set the zClass to some non-existant class so that you don't suffer any of the default css.

component.setZclass("Non_Existant_Class");

This must be done at many levels. For example in the grid I had to do so for the cell, and the row, and the header.

link publish delete flag offensive edit

answered 2012-11-07 09:23:15 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Thanks for the information.

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: 2012-10-09 21:00:41 +0800

Seen: 167 times

Last updated: Nov 07 '12

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