Custom Calculated String Column From Multiple Columns

Tags: #<Tag:0x00007f8b1aca34e0>

What’s the best way to go about creating a column that is the concatenation of a couple different columns.
For example
Col A = John Col B = Smith Col C = John Smith

I thought about doing this after a cell change, but then if I use the setDataAtCell, I can see how that would be an infinite loop. I need this to be such that I can write a custom function that handles the concatenation since there are rules I need to apply for certain columns (max length, uppercase etc).

Is that possible?

Thanks,

Joe

Hi @jmasar

The first thing that comes to my mind after formulas (it it may affect the performance) is a renderer. Here is an example https://jsfiddle.net/ncs2y0fk/

Can you tell me more about the other requirements

since there are rules I need to apply for certain columns (max length, uppercase etc).

I think that will do exactly what I want. I hadn’t thought of using the renderer since I wasn’t sure how to get the value of the other cells from within it.

The requirements were for a product data entry system. I’m using several new columns such as color, size, base description, weight to create an aggregate column to push into our old ERP system which has a limit of 30 characters.

Here’s the fiddle I created from your example. https://jsfiddle.net/2kbtq491/

Thank you very much!

Great :slight_smile: I am happy that it meets you requirements.

Please, however, remember that the renderer does not save the value in the cell. That is why if I edit any cell in column D there is nothing I can change within it.

Thanks, That’s actually exactly how I want it to work in this case. :slight_smile:
I want column D to be an aggregate and not something that can be edited directly.

Thank you!

Great. Thank you for confirmation. I am glad that it works as you wanted.

So I believe that we can close the topic.