:: Forum >>

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?
John
Wednesday, December 30, 2009
You can overwrite any js object method with your code -

var oldrefresh = obj.refresh;

obj.refresh = function(){
// your code here
oldrefresh.call(this);
}

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 -

http://www.activewidgets.com/aw.system.html/setsize.html
Alex (ActiveWidgets)
Monday, January 4, 2010

This topic is archived.


Back to support forum

Forum search