如何从slickgrid中的自定义组件获取输出?

问题描述 投票:2回答:1

我有离子型应用程序,并且在slickgrid中使用了自定义组件。我可以从slickgrid向组件输入。但是我没有收到从组件发送到slickgrid的输出。

 renderAngularComponent(cellNode: HTMLElement, row: number, dataContext: any, colDef: Column) {
    if (colDef.params.component) {
        const componentOutput = this.angularUtilService.createAngularComponent(colDef.params.component);
        Object.assign(componentOutput.componentRef.instance, { selectedItem: dataContext, a: this.a, b: this.b });
        setTimeout(() => $(cellNode).empty().html(componentOutput.domElement));
    }
} 

通过这种方式,我在列定义中调用了上述方法

asyncPostRender: this.renderAngularComponent.bind(this)

这将为组件提供输入。请指导在slickgrid组件中接收输出或回调的方法。

angular slickgrid angular-slickgrid
1个回答
0
投票

[componentOutput.componentRef.instance保存组件实例,所以您只需要手动附加输出属性,例如,如果有save

componentOutput.componentRef.instance.save.subscribe(()=>{console.log("method called");
© www.soinside.com 2019 - 2024. All rights reserved.