I'm currently giving ag-grid
a try and trying to build a table where if the user clicks a column value, they are taken to a page containing that entry's details.
How can I make a cell value clickable in ag-grid?
I've tried using valueGetter: this.urlValueGetter
with columnDefs
and:
urlValueGetter(params) {
return '<a href='bill/' + params.data.id + ''>details</a>';
}
but it now looks like this:
I then tried using template: '<a href='bill/{id}'>details</a>'
which does show the cell text as clickable but the id is not replaced. I assume this could work if I could somehow pass in the id?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…