gridContext.addOnLoad (客户端 API 参考)

将事件处理程序添加到 Subgrid OnLoad 事件事件

支持的网格类型

只读和可编辑的网格

Syntax

gridContext.addOnLoad(myFunction);

参数

Name 类型 必选 Description
myFunction 函数引用 是的 子网格加载时要执行的函数。 该函数将添加到事件处理程序管道的底部。 执行上下文自动作为第一个参数传递给函数。 有关详细信息,请参阅 执行上下文

注解

若要获取, gridContext请参阅 “获取网格上下文”。

Example

将 myContactsGridOnloadFunction 函数添加到 Contacts 子网格 OnLoad 事件。

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

removeOnLoad