Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sachin on Dec 08, 2008 01:10
open dhtmlx forum
How to increase the grid height dynamically

Hi,

My requirement is to according to the browser resolutions the grid height should increase / decrease dynamically.

For this i am calling the following function
function fnResize() {
cht = document.body.clientHeight;
gridDiv = document.getElementById('gridbox');
if (cht > 600) {
gridDiv.style.setExpression("height", cht*0.35);
}
}

But the grid height is not changing.
Please suggest some alternatives.

Thanks,
Sachin M
Answer posted by Support on Dec 08, 2008 01:35
Just change your code as
if (cht > 600) { 
     gridDiv.style.setExpression("height", cht*0.35); 
     mygrid.setSize();
}

Where mygrid - reference to the grid object created in related container.

Answer posted by JK on Mar 26, 2009 10:38
I verified dhtmlxGrid API there is no function called setSize()

     mygrid.setSize();
Answer posted by dhxSupport on Mar 27, 2009 03:29

Sorry for the inaccuracy, should be:

if (cht > 600) { 
  gridDiv.style.setExpression("height", cht*0.35); 
  mygrid.setSizes();
}