Dynamically scaling grid size
Hi!
I use the Activewidgets grid in an application that is dynamically scaled so that the layout depends on the size of the browserâs client area. The problem is that the dimensions of the grid are reset to their initial values (100%) after sorting or resizing a column and also after it finishes loading data. So I canât use the window.onload or window.onresize events that I use to scale other application elements. To scale the gridâs height I currently let the browser call a function every 1000 msec. Something like:
This does the trick, but I suspect there are better ways. For example, by programming one of the gridâs event handlers (onRefresh?). Can anyone tell me how this should be done?
Thanks in advance
I use the Activewidgets grid in an application that is dynamically scaled so that the layout depends on the size of the browserâs client area. The problem is that the dimensions of the grid are reset to their initial values (100%) after sorting or resizing a column and also after it finishes loading data. So I canât use the window.onload or window.onresize events that I use to scale other application elements. To scale the gridâs height I currently let the browser call a function every 1000 msec. Something like:
obj.setId("grid");
var browseHeight;
function scaleGrid(){
browseHeight=document.body.clientHeight;
document.getElementById("grid").style.height=browseHeight+'px';
}
function scaleApp() {
scaleGrid();
// Scale other elements
//..
}
window.setTimeout("scaleGrid();", 1000);
window.onload=scaleApp;
window.onresize=scaleApp;
This does the trick, but I suspect there are better ways. For example, by programming one of the gridâs event handlers (onRefresh?). Can anyone tell me how this should be done?
Thanks in advance
Bart H.
May 13,