Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.71 KB

File metadata and controls

55 lines (39 loc) · 1.71 KB
title description author ms.author ms.date ms.reviewer ms.topic applies_to search.audienceType contributors
gridContext.addOnLoad (Client API reference) in model-driven apps| MicrosoftDocs
Includes description and supported parameters for the gridContext.addOnLoad method.
fikaradz
fikaradz
03/12/2022
jdaly
reference
Dynamics 365 (online)
developer
JimDaly

gridContext.addOnLoad (Client API reference)

[!INCLUDE./includes/addOnLoad-description.md]

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.

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);
}

Related articles

removeOnLoad

[!INCLUDEfooter-include]