Creating Lightning Data Table with Custom Data Types
Hi all, In this blog, we are going to explore defining custom types in lightning datatable. Before you define custom type, please check if your data type is going to be one the below listed type as lightning-datatable component support these standard data types. action boolean button button-icon currency date date-local email location number percent phone text (default) url You can define custom data types by using two approaches. Extending LightningDatatable class. Use this approach, if your use case is simple and It doesn't require use of dynamic custom types. Use a slot . Use this approach, if you want to use dynamic custom type or require custom styling. Pass the custom types into the lightning-datatable component in a slot. In this example, we are gonna use first approach, Extending the LightningDatatable class. You can extend from LightningDatatable only to create custom data types. We are going to define three custom data type - opportunity name in...