Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dactar on Mar 26, 2008 13:28
open dhtmlx forum
autoheight grid vs maximise

If I maximise a window containing a grid with option enableAutoHeight set to true, the grid will redraw (cool) but the header of the grid move when I move the scrollbar (not cool)

If I maximise a window containing a grid with option enableAutoHeight set to false, the grid will not redraw (not cool) but the header of the grid doesn't move when I move the scrollbar (cool)

Is there a way to be cool twice in same time ?

Thanks :)
Answer posted by Support on Mar 27, 2008 02:19
>>Is there a way to be cool twice in same time ?
yes, it is possible :)

Please check attached sample - it shows two possible ways ( one for documents with doctype, second for documents without doctype) to implement auto-size behavior
The main idea - to have one more div around grid, with width as 100% and force grid to reflect its sizes, in mode without doctypes it requres only set height as 100%, in doctyped mode call of enableAutoHeight required.
Attachments (1)
Answer posted by dactar on Mar 27, 2008 04:21
Hellowww :)

It's works great with normal windows, but not with dthmlxwindows.
If I maximise a dhtmlxwindows attached to your sample, I've 2 vertical scrollbars.

Is there a way to fix this ?
Answer posted by Support on Mar 27, 2008 06:39
The next code may resolve problem

winPr.window(id).attachEvent("onresize",function(){
    mygrid.setSizes();
});

as result, each time when window resized, grid will update its sizes as well.
We plan to add native integration for grid and window, but it will be included only in next version of dhtmlxwindow.
Answer posted by dactar on Mar 27, 2008 08:40
Yes it works with the following code :

win.attachEvent('onMaximize', function resize(){mygrid.setSizes()});
win.attachEvent('onMinimize', function resize(){mygrid.setSizes()});

Thanks a lot :)

PS : setSizes() is not in the documentation (API functions)