How to add to obj.refresh()

On my page I have a couple header bars with menu and navigation, and then a big AW Grid that should fill the rest of the browser window. I do this using javascript and adjusting the height of the grid based on the viewport height - the size of the header - some padding value. I've condensed this into a function which resizes the grid, and I call it in my body tag thusly: <body onload="sizeGrid()";>

I have a problem, though. Any time the grid is refreshed, for any reason, I need to also call the resize function, because when the grid is refreshed it likes to revert back to the original full height of the browser, which causes it to extend off the bottom of the screen and I get multiple scrollbars and in general that's a bad thing.

Is there a way to add to obj.refresh(), such that it will just always call my sizeGrid() function after it is refreshed?
December 30,
You can overwrite any js object method with your code -

var oldrefresh = obj.refresh;

obj.refresh = function(){
// your code here

However it seems like your problem is because you adjust the style of the DOM node instead of calling the grid.setSize(w, h) method -

Alex (ActiveWidgets)
January 4,

This topic is archived.

See also:

Back to support forum