Pop up from Salesforce lightning datatable
729 views
Oct 28, 2024
LightningModal can be used in the Salesforce Lightning Web Component lightning-datatable for Pop Up window or screen. Blog Post: https://www.infallibletechie.com/2024/10/pop-up-from-salesforce-lightning-datatable.html
View Video Transcript
0:00
Hello everyone, in this video we are going to see how to achieve pop-up screen when using
0:16
Lightning Data Table in Salesforce Lightning web component. Let's look at a demo here
0:26
I'm going to search account. accounts with the test in the name and also I'm going to select a few industries here
0:38
so I have selected three industries agriculture apparel and technology so I'm
0:46
going to fetch accounts with the industries agriculture apparel and technology and have name which content and the name should contain test
0:58
So these are all the test account records and the industry for all these accounts is technology And then if I have a column saying that whether contacts are available for this account or not if it is yes it will display
1:21
view contacts link when I click it it will show a pop-up saying that this is the
1:28
contact name and this is the title for this particular contact so let's
1:36
see how to achieve this pop-up screen. And I'm using Lightning Data Table to display the contact records
1:50
This is my apex class where I am fetching account records based on the name that was passed
1:57
and the list of industries that were selected. which I am using SOQL to fetch those account records
2:10
I am using Lightning Model. So this is the Lightning Web component which displays that contact records Since this is a model pop component I not using any other target
2:33
Let me close the apex class and the component and this is the lightning web
2:40
component using which I am testing it. So I'm displaying account name, the industry, I
2:48
I'm using Lightning button menu and Lightning menu item to display the drop-up, drop-down for
2:55
industry's selection. Using Lightning Data table, I'm displaying all the account records
3:05
Whenever they click view contacts, it will call this Handel Row Action
3:13
So here using this handle row action, I am opening the Lightning Model pop-up component and
3:28
then I am passing the selected accounts contact records to it to display it within the pop screen or window I using the target as lightning double
3:46
underscore tab because I have created a tab to open and search accounts and then
3:54
make use of view contacts to view the contacts in the pop-up window
4:06
Please check the video description. In the video description, I have shared my blog post
4:11
From the blog post, you should be able to get the sample lightning web components and the
4:16
apex class code for your reference. I hope it was helpful
4:29
Thank you for watching
#Internet Software