gridContext.addOnLoad (Client API reference)
Adds event handlers to the Subgrid OnLoad event event.
Read-only and editable grids
gridContext.addOnLoad(myFunction);
Name | Type | Required | Description |
---|---|---|---|
myFunction |
function reference | Yes | The function to be executed when the subgrid loads. The function will be added to the bottom of the event handler pipeline. The execution context is automatically passed as the first parameter to the function. See execution context for more information. |
To get the gridContext
, see Getting the grid context.
Add the myContactsGridOnloadFunction function to the Contacts subgrid OnLoad event.
function myFunction(executionContext) {
let formContext = executionContext.getFormContext(); // get the form context
let gridContext = formContext.getControl("Contacts");// get the grid context
let myContactsGridOnloadFunction = function () { console.log("Contacts Subgrid OnLoad event occurred") };
gridContext.addOnLoad(myContactsGridOnloadFunction);
}