Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by gilles on Jan 18, 2010 02:44
open dhtmlx forum
dhtmlxgrid height depending on window height

Hello,

I've to change the dhtmlxgrid's height after a window resize. But the height must be computed.
Is there a way to set of the grid's height with a formula or something else ?
Answer posted by Alex (support) on Jan 18, 2010 02:50

Hello,

grid adjusts its sizes to the sizes of its parent contain when window resizes. So please check that grid container size changes (the size is set in percent).

In common case you can change the sizes of grid conatiner and the grid.setSizes() to adjust grid sized.

Answer posted by gilles on Jan 18, 2010 03:44
Thank you for your answer.

I've a small problem : while I resize slowly the window, the bottom's grid flashes (see exemples file).
It's possible to avoid this ?
Attachments (1)
Answer posted by Alex (support) on Jan 18, 2010 06:11

The reason for the problem is resize event handler that you have set. Try to use the following instead:

var _resize_timer

$(function(){
  $(window).resize(function(){
      window.clearTimeout(_resize_timer);
      _resize_timer=window.setTimeout(function(){
           setGridHeight();
      }, 100);
  });
});