angular - unable to call services in agGrid(Angular2) by cell renderer option -


i using ag-grid displaying list of user .if edit user details,then want click update button in grid edit corresponding user details.

this coloumn header in ag_grid

 { headername: 'update', field: "update", width: 80, cellrenderer:this.updaterenderfunction}       

i using cell renderer

updaterenderfunction(params){    var espan = document.createelement('button');    espan.innerhtml = "update";     var data = params.node.data;     espan.addeventlistener('click',()=>{                        //here want call service    })    return espan;   } 

try worked me...give bind(this) after updaterenderfunction below.

{ headername: 'update', field: "update", width: 80, cellrenderer:this.updaterenderfunction.bind(this)}  

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -