
Build a lightning web component (LWC) that displays a static employee data table using lightning-datatable, defining columns and data for eight employees, with phone and email formatting and clickable links.
Create an apex class named contact data table controller with a public static getContacts method that queries name, account name, phone, email, and mailing address for a lightning data table.
Update the JavaScript controller to fetch contacts via the Apex data table controller, map fields to name, account name, phone, email, and mailing address, and display them in the datatable.
Format Salesforce contact data for a lightning data table by mapping account name and mailing address fields into display keys, using optional chaining to handle missing data.
Mastering lightning datatable in Salesforce LWC teaches formatting data by type, turning phone and email into clickable actions and linking contact and account names to their detail pages.
Define row actions in a lightning datatable, adding a view, edit, and delete action column, and handle clicks with a row-action handler that uses event.detail.action.name and event.detail.row.
Add sorting to every column in the lighting data table and set the default sort by name ascending. Implement a handleSort method to process sort events.
Implement handleSort and sortBy to sort datatable records by a clicked field and direction, using a cloned context with the spread operator and a compare function.
Learn to hide default header actions in lightning data table and set wrap text as default for all columns, including account, phone, email, street, and city.
Add a custom header action to a lightning datatable, configure lead source actions, and filter records by the selected lead source using a header action handler.
Define handleHeaderAction to read event.detail action and column definition, update the target column's actions, and recreate the columns array to force the data table to reflect the checked header option.
Filter lightning datatable records by lead source using header actions in Salesforce LWC. Define inactive lead sources in JavaScript, and store an original context for reset when all is selected.
Disable column resizing, remove wrap text, then switch to auto column widths mode to let columns expand based on data, creating a responsive table with scrolling.
Discover how fixed column widths mode enforces equal widths and prevents resizing when data changes. Set minimum and initial widths and enable wrap text for readability.
Learn to programmatically select rows in a lightning datatable by default, using the record ID as the key, binding an on row selection handler, and updating the selected rows array.
Explore how slice() selects the first three contacts from a contacts array and how map() transforms those results into an array of IDs (or names), including handling selected rows.
Enable infinite loading in the lighting data table by using limit and offset to load records in chunks as you scroll, and update the apex controller to support these parameters.
Update the get context logic by creating a query context method to load contacts based on limit and offset, then concatenate new results for infinite scrolling in the data table.
Learn to simplify lightning datatable code by querying contacts only when there are records, chaining update total records count with the contact query, and implementing robust infinite loading with offset.
Learn how to manage lightning datatable attributes like is loading and enable infinite loading using component level variables, replace event.target references, and bind data via context arrays for updates.
Learn a new approach to infinite loading with datatable filters: remove the original context, update total records count on each filter, and overwrite or append the contacts array accordingly.
Define a records filter map to apply filters to the SQL query and enable infinite loading for the data table while updating records count and managing context when filters change.
Add dynamic row level actions to the lighting data table in Salesforce LWC. Use a get row actions method and a callback to tailor each row's actions by lead source.
As a salesforce developer, you'll come across many instances in multiple projects where you need to show records in a table. Lightning Datatable is a reusable component provided by salesforce using which you can display records easily. Welcome to Mastering Lightning Datatable in Salesforce LWC course, where you'll learn everything about lightning datatable from scratch. It doesn't matter if you've implemented lightning datatable before in LWC or not. We'll start from the very basics i.e. implementing a working lightning datatable from scratch within 10 minutes which will show static data and will go till advanced level, including our own custom datatable cell component.
While you'll find many courses/platforms that covers LWC basics, it doesn't offer a comprehensive, hands-on guide to mastering the lightning-datatable component. This course is designed to fill that exact gap.
Get straight to the point. Stop sifting through 40-hour LWC bootcamps for the one component you need. This course is a focused, 8-hour deep dive into every feature of Lightning Datatable.
To give you a high level idea, starting from the very basics of datatable, we'll cover a lot of topics including but not limited to: row level actions, header actions, infinite loading, sorting, defining a custom cell type, validations and interaction with apex controller.
Course Features
HD Videos
Detailed Explanations
All Concepts Covered - Beginner to Advanced
Extra Learning Resources
Certificate of Completion
The course is your stepping stone in becoming an amazing salesforce developer. We'll be doing a lot of coding and lwc development in this course which is super fun starting from the very first video. It'll not only help you master lightning datatable implementation in lwc, it'll also help you to level up as a salesforce developer. We'll code a lot of JavaScript together, learn LWC concepts like: child to parent communication using events, custom attributes etc. and thereby implement some amazing functionality in lightning datatable which you might have never implemented before!
This course is taught by Rahul Malhotra, who is a blogger and youtuber at SFDC Stop. He has delivered various live technical sessions at International and National Salesforce Conferences and other global gatherings including ApexHours, Cactusforce 2022, TrailheaDX India 2019, Dreamforce 2018, IndiaDreamin 2018, Jaipur Developer Fest 2018 as well as other global gatherings of Salesforce.