You need to sign in to do that
Don't have an account?
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
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
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.
Hi Subrat,
Got it, thank you