Access class variable inside renderers

Tags: #<Tag:0x00007fd2caa37128>

I am using renderers on my column data that gets displayed. Is there a way to access the class variable inside the renderers?

public class ABC {
accessThisVariable = true;
{ data: ‘id’, type: ‘text’, renderer: this.dataRenderer},
{ data: ‘name’, type: ‘text’, renderer: this.dataRenderer}
dataRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
// access here the class variable ‘accessThisVariable’

Hi @krish,

Thank you for your question. I’m writing to let you know that we’re currently working on it and will get back to you soon.
Thank you for your patience.


That’s wonderful.

Hey @krish

have you tried this approach Does it meet your requirements?

I haven’t tried. Let me try.


I am not able to access that in the renderer as shown in fiddler. Gives error
I have a constructor:

const that = this;
this.somecolumn = [
{renderer: this.callRenderer}

checkBoxRenderer(instance, td, row, col, prop, value, cellProperties) {

If it works in the Fiddle but you get the error some other code might be coming or you use a different class structure. I would need to check your code to give more hints.