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

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -