Posts

Showing posts with the label bind

Salesforce Fact #970 | Another example of bind HTML classes

Image
Here's another example of Bind HTML classes in LWC. In this example, we are fetching a list of account records and highlighting the ones of type = 'Customer - Direct' and NumberOfEmployees > 10000. Attached are the screenshots.

Salesforce Fact #939 | LWC bind HTML classes

Image
From LWC api version 62.0 onwards, we can manipulate an element or component's class list by using the class attribute. Instead of doing string concatenation, we can return an object or array for complex class names using a getter. It will eventually be rendered as a space separated string of class names. Reference:  https://developer.salesforce.com/docs/platform/lwc/guide/create-components-class-binding.html Attached are the screenshots.