data-bind click inside ag-grid cell renderer

142 views
Skip to first unread message

f37mw 827bj9f

unread,
Nov 21, 2020, 11:39:03 PM11/21/20
to KnockoutJS
Hi I'm trying to have clickable image in an ag-grid,

This is the HTML inside the cell
<a href='#' data-bind='click: $root.openChart'> ... </a>
I was expecting the function openChart to be called but when I click the image the page scroll to the top and the url has a # at the end
I also tried
<a href='#' data-bind='click:  function (data) { alarm('test') }'> ... </a>
same behavior and the alarm message doesn't show up.

My assumption is the data-bind attribute is completely ignored here. 

Note the HTML is written inside an ag-grid cell rendering, but when I inspect the element I see exactly what I'm expecting i.e. (<a href='#' data-bind='click: $root.openChart'> ... </a>)

Thank you
Reply all
Reply to author
Forward
0 new messages