2

I use this js-library with rails app. I want add cell that automaticaly generate url for editing row, and when we click it - its redirect for editing page.

User

id---|---name---|---Button
1    | Adam     | /edit/1 link
2    | Nikolay  | /edit/2 link
3    | Peter    | /edit/3 link

1 Answers1

7

You could try something like this in your columnDefs :

  {
    headerName: "Button", field: "id",
    cellRenderer: function(params){
      return "<a href='http://example.com/edit/" 
        + params.value 
        + "'>link "+params.value+"</a>";
    }
  }
Abderrahmane TAHRI JOUTI
  • 3,514
  • 2
  • 26
  • 43