Change size of scheduler at runtime

Hi,
I want to resize the scheduler at runtime.
Using something like

			scheduler.attachEvent("onViewChange", function (mode , date){
				if (mode == 'timeline')
					$('#scheduler').height(500);
				else
					$('#scheduler').height(1000);
			});	

doesn’t work well, because when the size changes from 1000 to 500 the scheduler gets “cut” (until browser window is resized which causes the scheduler to repaint).
How can I do this?
Thanks!

Try to use onBeforeViewChange instead of onViewChange

P.S. be sure to return true from onBeforeViewChange handler

It works, thx!