Pratik
Pratik

Reputation: 11

call component user define function in ag grid cellClick() event

I have created

    this.xxxsetgridOptions = {
        rowSelection: 1,
        columnDefs: this.setvsp_param_columns,
        onCellClicked: function (params) {
            params.node.data["is_row_update"] = 1;
            this.setValidator();


        },
        getRowStyle:function(params){
            if(params.data.is_new_rec==1) {
                return {'background-color': 'rgb(192,192,192)'}
             }
        },
        suppressScrollOnNewData:true,
        rowHeight:28,                      
    };

this is this.setValidator(); component's function. so i want to call this function when ag grid cell clicked? how to call this in angular 2?

Upvotes: 0

Views: 2820

Answers (1)

koolhuman
koolhuman

Reputation: 1651

self=this;

this.xxxsetgridOptions = {
        rowSelection: 1,
        columnDefs: this.setvsp_param_columns,
        onCellClicked: function (params) {
            params.node.data["is_row_update"] = 1;
            self.setValidator();


        },
        getRowStyle:function(params){
            if(params.data.is_new_rec==1) {
                return {'background-color': 'rgb(192,192,192)'}
             }
        },
        suppressScrollOnNewData:true,
        rowHeight:28,                      
    };

Upvotes: 2

Related Questions