Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by chad on Nov 20, 2008 09:43
open dhtmlx forum
split grid. resizing grid to fit resized window

I found this article you had addressed earler:

"Question posted by Daniel Balandran on Feb 28, 2008 17:22 open in interactive version

Resizing a window in spilt mode

I am trying to get the scroll bars to resize with the window when the grid is in splitAt() mode. I there a work around for this. I don't want the columns to resize with the window, just the scroll bars.

Thank you
Answer posted by Support on Mar 04, 2008 03:43
While there is no public API, you can set the width of left area of grid as
grid._fake._correctSplit(width_as_int)

If width will be lesser than summ of columns heights - the scrollbar will appear."

I'm trying to do the same thing, to get the right side of the split grid to resize to fit the new window width. I am running something like this in javascript:

document.body.onresize = function (){
var width = document.getElementById("cgrid2_??????").style.width;
grid._fake._correctSplit(width);
}

The problem is that the width of the frozen columns id changes each time you load the page. All i know is it has the prefix of "cgrid2_". How can I find the current width of the frozen cols?
Answer posted by Support on Nov 21, 2008 01:59

>>How can I find the current width of the frozen cols?

Technically you can use getColWidth command for all leftmost columns, and calculate actual widht of left part. 
Also, next can be used
visible width of left part
     grid._fake.objBox.offsetWidth;
full width of left part
     grid._fake.objBox.scrollWidth;