AnswerBun.com

Conditionally disabling an editable field in lightning Datatable

Salesforce Asked by Mohammed Aiyaz on August 14, 2020

I have a requirement that an editable field in Datatable should be editable on certain conditions for example lets say, i have a field Disable_Action__c which is a formula field , when this field evaluates to false i should be able to edit the field which is there in Datatable.

One Answer

It is not possible to make a field conditionally editable. The way I solved it, was to change the cellattributes conditionally, so I changed the background color to indicate to the user that something is different:

cellAttributes: { class: { fieldName: 'CSS_Class_Quantity__c' } }

But that is not enough, your Javascript code must not take into account the entered data. It would be much easier if editable was conditional, but alas, it isn't at this moment.

Answered by Sander de Jong on August 14, 2020

Add your own answers!

Related Questions

GraphQL and Salesforce Development

2  Asked on November 25, 2021 by tekill

       

DataLoader Command Line – Error

1  Asked on November 25, 2021 by vishal-nayak

 

Error while Download excel file using vf page

0  Asked on November 25, 2021 by sai-venkat-prakash

 

Store Output Values tab missing from flow builder

1  Asked on November 25, 2021 by sfdc-dev-27

 

EventLog File Enable Hourly Logging

1  Asked on November 25, 2021 by maestro

 

The QS parameter in marketing cloud

1  Asked on November 25, 2021 by ciouz

 

Most robust way to parse CSV file via Apex code

1  Asked on November 23, 2021 by laureant

     

Lightning navigation new tab

1  Asked on November 23, 2021 by sfdcnoob

 

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir