Are there any renderers that I can use to display an ‘html button’ in one of the columns.
- The text of button is dynamic (say ‘go to 1’)
- On click of that button , I should highlight a row (row 1) in another table
Are there any renderers that I can use to display an ‘html button’ in one of the columns.
Yes, @krish
you can use the html
renderer. Here is an example with a button https://jsfiddle.net/handsoncode/agou836c/ to change the button’s text you’d need to use the setDataAtCell
function.
Tha’s nice , that handsontable allows to display HTML content inside the columns required. Can we add a click event on those, which triggers some action outside the renderers.
Assuming my col is displayed like,
{ data: ‘rowNum’, type: ‘text’, renderer: ‘html’, readOnly: true },
and in setDataCell, I have
this.instance = this.hotRegisterer.getInstance(tableInstance).getInstance();
this.instance.setDataAtCell(i, 0, ’ click Row ’ + (i + 1) + ‘’);
@aleksandra_budnik, I managed to work on this by using innerhtml in the renderers and onclick call a javascript function. Thanks
Glad to hear that. Thank you for an update.
Feel free to create a new topic if needed.