StandardControl.init
Used to initialize the component instance. Components can kick off remote server calls and other initialization actions. Dataset values cannot be initialized here, use the updateView method to achieve that.
trackContainerResize should be called once, preferably in the component init
method to notify that the component needs the layout information. Use this method to tell the framework to populate allocatedHeight
and allocatedWidth
methods.
Note
tractContainerResize should be called first before the allocatedHeight
and allocatedWidth
methods.
Available for
Model-driven apps, canvas apps, & portals.
Syntax
init(context,notifyOutputChanged,state,container)
Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
context | Context | yes | The Input Properties containing the parameters, component metadata, and interface functions. |
notifyOutputChanged | function |
no | The method to notify the framework that it has new outputs |
state | Dictionary |
no | The component state that is saved from setControlState in the last session |
container | HTMLDivElement | no | The div element to render |
Example
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement)
{
this._labelElement = document.createElement("label");
this._labelElement.setAttribute("class", "HelloWorldColor");
container.appendChild(this._labelElement);
}
Related articles
Control
Power Apps component framework API reference
Power Apps component framework overview
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기