如何使用新子类的agGrid事件属性?

时间:2019-07-24 03:18:45

标签: angular typescript ag-grid ag-grid-angular

我在agGrid中使用Angular。我正在使用agGrid的 onCellValueChanged 属性来注册单元格值的更改。请在这里找到代码:-

import { Component, OnInit } from '@angular/core';

@Component({
    selector: 'master-gender',
    templateUrl: 'app/PortalPages/MasterPages/GenderMaster/gender.component.html',       
})

export class GenderComponent implements OnInit {
    private updateDict = new Map();
    genderRowData: [];  

    constructor(private genderService: APICallService) {
    }

    ngOnInit() {           
    }

    columnDefs = [
        {
            headerName: 'Gender Name', field: 'Name',          
            cellEditor: 'agLargeTextCellEditor',                
            onCellValueChanged: this.genderCellValueChanged.bind(this)          
        },
    ]

    genderCellValueChanged(event: any) {
       //Custom Code for registering event
    }
}

是否可以通过任何方式将 genderCellValueChanged 移至其他组件类,即子类并在父子组件之间共享价值?

0 个答案:

没有答案