PDA

View Full Version : Default CSS Renders Grid with headers only



abaer
8 Sep 2006, 7:27 AM
Is it me, or when I use the default CSS I get a table that has headers but no rows.

If I remove the

position: absolute;

from the

.ygrid-wrap-body

Style, then the grid works great.

By the way, I think you've done a wonderful job!

jack.slocum
8 Sep 2006, 3:00 PM
Hi Abaer,

It sounds like you don't have a size defined for your container element. Here's a quote from the tutorial post:

Next we create our Grid object. The first parameter to the grid constructor is the container element where the grid is to be rendered. The grid adapts to the containers size - so the container MUST have a size. For example, rendering the grid to a div tag with no width and height specified will result in the grid adapting to a width and height of 0 and not appearing. Also, if the container does not have a position set of absolute or relative, the grid will automatically make it relative.

When there is no size on the container element, only the headers appear, the grids body is width:100%, height:100% and overflow:auto. So it will fit itself to the container you put it in, but if you don't give that container a size, width:100% and height:100% will both be 0.

This is the most common problem, but if that doesn't fix it for you, let me know.

Thanks,
Jack

abaer
13 Sep 2006, 7:26 AM
That fixed it. My mistake.