Can I change the height of the grid when the browser window is resized so that my footer is always at the bottom of the window? (The width automatically changes correctly).
Thanks,
Ben
If you have height of grid defined in percents - grid will adjust it to height of surrounding container after browser’s resize.
This doesn’t seem to be the case, I have dynamic smart rendering on , would this make a difference?
In case of SRND mode grid may have some white-space not filled with rows, while resizing from smaller size to bigger one, but the sizes of grid on the page will be calculated correctly without relation to the modes of grid.
If necessary , we can provide some kind of a sample.
Yes, please show me an example, I have the height of the grid container set 100% but when I resize the window (browser) the height does not change. Thanks, Ben
Hi,
Ok I have found the problem, if I include the following doctype in my page (using a height of 100%)…
The grid does not display correctly, only the headers display but the rows do not. Is there a workaround for this (apart from taking out the doctype?)
Thanks,
Ben
Sorry, was a my typo in the sample
Change
/* fixing body’s height in standard mode /
html body{
as
/ fixing body’s height in standard mode */
html, body{
and it will work with all doctypes
Hi,
Thanks for that but I am unable to set 100% height on the body of the page, I have a
Thanks,
Ben
Can you please provide the html snippet, used in problematic case.
I have the grid resizing ok now thanks by setting the height of the surrounding div programitically. Although now I have a problem when I am recreating the grid without a browser refresh. I use the destructor before recreating the grid but then if I re-size the browser window the grid no longer resizes correctly?
I have attached an example of the problem I have. If you resize the browser window and click the resize button the grid should change the height of the browser window ( minus the offset). This works fine in Firefox but not in IE8, do you have any suggestions to make this work?
Thanks,
Ben
Example.zip (90.9 KB)
During initialization grid clears initial width and height settings from the container. So when the second grid is initialized in the same container , there is not height and width settings, which are enabling auto-size first time.
To fix the problem, change the reloading code as
mygrid.destructor();
var obj = document.getElementById(“gridbox”);
obj.style.width = “100%”;
obj.style.height = “100%”;
mygrid = new dhtmlXGridObject(‘gridbox’);