grid not resizing in a div


I have a div holding a grid. The div has width and height set to 100%; when the browser is resized the grid does not resize with the rest of the browser. When I examined the DOM I found that the div width and height had been reset to the browsers previous width and height, apparently by dhtmlx. The code follows:

var mygrid = new dhtmlXGridObject(‘gridbox’);

I have tried using:

grid.attachEvent(“onResize”, function(cInd, cWidth, obj){

as well as:

dhtmlxEvent(window, ‘resize’, function(e) {

but nothing has worked. I know I can get the grid to resize by attaching it to a full page layout, but I need to get it to resize inside the div.

Any help would be greatly appreciated.



Oops, there is a typo in the original message; the div’s width is “100%” and not “105”



Please, try to set the withs of your columns in percentages: … nitwidthsp

or use “*” in one of the columns width.

Hi Sematik,

Thanks for your reply. Yes I am already using the setInitWidthsP() function as follows:


but the grid still does not resize. What is the correct way to use the setSizes() function, is it inside of a grid.attachEvent(“onResize”) or a dhtmlxEvent() function, and should it be before or after the init?

Thanks for your help.


Here you can find a working example of the grid changing the column widths accordingly to the container sizes: … esize.html

If issue still occurs for you - please, provide us with any kind of sample of your code or a complete demo where the issue can be reproduced.