OnResizeWindow - cWebApp
Fired when the window size of the browser changes at runtime and during initialization
Type: Event
Parameters
| Parameter | Type | Description |
|---|---|---|
| iWindowWidth | Integer | Width of the browser window in pixels |
| iWindowHeight | Integer | Height of the browser window in pixels |
Syntax
Procedure OnResizeWindow Integer iWindowWidth Integer iWindowHeight
Description
This event is fired when the window size of the browser changes at runtime and during initialization.
This event can be used to make the WebApp responsive to the screen size by changing properties like pbShowLabel, piColumnCount and piColumnSpan using WebSet. The event gets the browser window size in pixels as parameter.
Sample
The example below shows how this event can be used to change the layout of the view by reducing the piColumnCount, which will push controls to the next line if they don't fit any more.
Set pbServerOnResizeWindow to True
Procedure OnResizeWindow Integer iWindowWidth Integer iWindowHeight
If (iWindowWidth < 600) Begin
WebSet piColumnCount to 6
End
Else Begin
WebSet piColumnCount to 12
End
End_Procedure