How to apply Custom Renderer

Confluence User - 19 Jun, 2018

Hi,

 

I'm trying to create a custom renderer like the color coded fonts from https://handsontable.com/features

documentation from Spreadsheet isn't clear on how to apply it in the custom settings. Is there any examples that I can follow?

forms;spreadsheet

2


20 Jun, 2018
confluenceUser
1
confluenceUser

Hi, 

You can just paste the following code in your column format. 

{{
    renderer : function(hotInstance, TD, row, col, prop, value) {
        var colors = {
          Red: '#e87677',
          Green: '#66e100',
          Blue: '#00a7fe',
          Purple: '#6623e2',
          Orange: '#ffad24',
          Yellow: '#ffe300',
        };
        TD.style.color = colors[value];
        TD.textContent = value;
    }
}}

 

Best regards.

20 Jun, 2018
confluenceUser
confluenceUser

perfect! thanks.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print