从另一个组件获取对话框状态

时间:2021-05-13 07:15:07

标签: reactjs react-functional-component fluentui-react powerapps-modeldriven

我有一个 PCF,它在同一个 index.ts 中加载了几个组件:主容器、旁侧容器和另一个加载对话框组件的容器。这个对话框包括一个下拉控件,它从 index.ts init 过程加载一些项目。我可以从其他组件中获取选定的值吗?

我的 index.ts:

public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container: HTMLDivElement) {
    this.container.appendChild(this.containerMain);
    this.container.appendChild(this.containerAside);
    this.container.appendChild(this.containerDialog);
    // actions to populate this.list with WebAPI.retrieveMultipleRecords
    ReactDOM.render(
        React.createElement(Dialog, Object.values(this.list)),
        containerDialog);
...   

public updateView(context: ComponentFramework.Context<IInputs>): void {
    ReactDOM.render(
        React.createElement(Main),
        this.containerMain);

    ReactDOM.render(
        React.createElement(Buttons),
        this.containerAside);

}

对话框组件就是这个 Fluent UI component,必须在组件加载时打开。

我的问题是,我可以从对话框中保存用户的选择,以便用它修改其他组件吗?

0 个答案:

没有答案
相关问题