Grids and subgrids in model-driven apps
Reference: 1 2 3
Adds event handlers to the Subgrid OnLoad event event.
Grid types supported
Read-only and editable grids
Syntax
gridContext.addOnLoad(myFunction);
Parameter
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. |
Remarks
To get the gridContext
, see Getting the grid context.
Example
Add the myContactsGridOnloadFunction function to the Contacts subgrid OnLoad event.
JavaScript
function myFunction(executionContext) {
let formContext = executionContext.getFormContext(); // get the form context
let gridContext = formContext.getControl("subgrid name");// get the grid context
let myContactsGridOnloadFunction = function () { console.log("Contacts Subgrid OnLoad event occurred") };
gridContext.addOnLoad(myContactsGridOnloadFunction);
}
No comments:
Post a Comment