function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vladyslav Lyfar 8Vladyslav Lyfar 8 

 Lightning-input-rich-text custom type for Lightning Datatable

Hello everyone,
I am trying to add lightning-input-rich-text component as editTemplate for the cell of richtextarea custom type but constantly receiving engine error.
The one when I am trying to type any value

Uncaught TypeError: this.concreteComponent.showHelpMessageIfInvalid is not a function
throws at https://sparks--test--c.sandbox.vf.force.com/components/lightning/primitiveDatatableIeditTypeFactory.js:1:4612



The the other one when I click outside the rich-text-input component

Uncaught TypeError: Cannot read properties of undefined (reading 'valid') throws at https://sparks--test--c.sandbox.vf.force.com/auraFW/javascript/wyQWsVjjDIx-Xsqekbsbwg/aura_prod.js:13:40835


The code for the edit template (richTextAreaEditTmpl.html):

<template> 
<lightning-input-rich-text value={editedValue} data-inputable="true" >
</lightning-input-rich-text>
</template>

Custom type definition in customDatatable.js

richtextarea: {
            template: richTextAreaTmpl,
            editTemplate: richTextAreaEditTmpl,
            standardCellLayout: true,
            typeAttributes: []
}
 


Are rich text areas supported by datatable at all?
Thanks for help

Best Answer chosen by Vladyslav Lyfar 8
SubratSubrat (Salesforce Developers) 
Hello Vladyslav .

Yes, rich text areas are supported in Lightning web components, including the lightning-input-rich-text component. However, there might be an issue with your implementation that is causing the errors you mentioned.

But the lightning-input-rich-text component is not directly supported as an edit type for the datatable. The supported edit types for the datatable include text, number, date, picklist, and checkbox.

For further reference and solution how to achieve this , i would request you to go through this discussion and let me know further -> https://salesforce.stackexchange.com/questions/274594/need-help-with-custom-types-in-lightning-datatable-lwc

If this helps , please mark this as Best Answer.
Thank you.

All Answers

SubratSubrat (Salesforce Developers) 
Hello Vladyslav .

Yes, rich text areas are supported in Lightning web components, including the lightning-input-rich-text component. However, there might be an issue with your implementation that is causing the errors you mentioned.

But the lightning-input-rich-text component is not directly supported as an edit type for the datatable. The supported edit types for the datatable include text, number, date, picklist, and checkbox.

For further reference and solution how to achieve this , i would request you to go through this discussion and let me know further -> https://salesforce.stackexchange.com/questions/274594/need-help-with-custom-types-in-lightning-datatable-lwc

If this helps , please mark this as Best Answer.
Thank you.
This was selected as the best answer
Vladyslav Lyfar 8Vladyslav Lyfar 8

Hi Subrat, 

Got it, thank you