Pass 2 values to custom renderer

Tags: #<Tag:0x00007f8b2863fa00>

In my custom renderer I need to display one value but create HTML Href link to another value (id) so I need 2 values – so in my column definiton I use this

{data: ‘breadth’,width: 25,readOnly:true, dropdownMenu: false, editor: false,renderer: ‘idHistoryRenderer’},

Then my custom rendered can use value of breadth in the display HTML –

function idHistoryRenderer(instance, td, row, col, prop, value, cellProperties) {

Handsontable.renderers.BaseRenderer.apply(this, arguments);

td.innerHTML = "<a onclick=\"showHistory('"+value+"', 'id');\" href=\"#\">"+ value + "</a>";
 //  console.log(td.innerHTML);
  return td;

}

But I need another value for actual object id – Q: How do I pass 2 values into custom renderer – or how do I pass the whole object into it as value?

Hey Allyson,

Renderer shows a different value than typed in data (what is available for an editor).

You may consider using metadata. You can add it to a cell using setCellMeta function.

Hi @allyson.vorob

how is the development going? Have you successfully build the instance?

There are no replies so I hope everything’s fine and running well.