+ Start a Discussion
Raghu Natha 2Raghu Natha 2 

LWC lightning data table on cell change data validation


I awant to validate the data in a editable data table cell change event


In JS file 
        console.log('Cell Data  : ' +JSON.stringify( event.detail.draftValues[0]));        

How to validate the above data and send an error message.
In the columns array i do have the column name type, lenght, so the validations that I am looking for is to check against the data type and length in the JS method.

Tahnk you

I guess this can help you to get it done.


#validation #javascript #lightning-datatable

More on displaying errors you can find here https://developer.salesforce.com/docs/component-library/bundle/lightning:datatable/documentation
search for Displaying Errors.
Himanshu Sharma 241Himanshu Sharma 241
This is a common issue i think you can visit InstaLyrics (https://instalyrics.com/)