OnGridInitialize Event
Description
This event fires when the Grid is initialized. It also fires when the Grid is re-initialized after a session has expired. If you want to override a Grid property, use the OnGridExecute event.
Discussion
This event fires when the Grid is initialized. It also fires when the Grid is re-initialized after a session has expired.
IMPORTANT: The onGridExecute event, which fires every time the Grid is executed fires BEFORE this event. If you want to override a Grid property, use the onGridExecute event.
The following variables are available to you in the event:
- Variable
- Description
- e.tmpl
The grid component definition
- e.rtc
Run-time calculations (allows you to pass data to other event handlers)
Example
'Define a list for a drop-down box e.rtc.list1 = comma_to_crlf("Red,Green,Blue")
Simulating Session Variables
To simulate session variables when running in Working Preview you can use this code:
if eval_valid("request.SERVER_PROTOCOL") then if request.SERVER_PROTOCOL = "A5RES" then 'running in working preview session.var1 = "simulated value for var1" end if end if
Setting State Variables
You can also set state variables in this event. The value of any state variables will be available in all subsequent ajax callbacks (in the e.__si2 object).
To set a state variable:
e._state.myvar1 = "value1" e._state.myvar2 = "value2"