Create button inside a cell dynamically

Tags: #<Tag:0x00007efc61c3d728>

Hello,

I need to add a button inside each row.
In the example code below, instead of names in NAMES column, I would like to add a button which says “View Names”.

Following is my code

Hi @thenaveenn

you can use a custom renderer that adds a button.

Here is an example http://jsfiddle.net/handsoncode/bra4qfy7/ for a single button and here for a columns http://jsfiddle.net/handsoncode/zram5uaL/

Hello,
Thanks a lot for those jsfiddles. I had some difficulty converting those JS to TS :smiley:
I have 2 problems now.


  • This “value” in cells in always undefined. I did a console.log() to confirm the same


  • Handsontable.renderers is throwing me error.
    Uncaught TypeError: Cannot read property ‘renderers’ of undefined

Am I missing anything?

Here are the arguments of the cells method: http://jsfiddle.net/s31pnnks/
You are using the arguments of the renderer inside the cells method.

Are you using Angular 2+?