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
Post a Comment