Custom list view in Lightning Web Component

LWC Stack is Lightning Web Component tutorial series by Salesforce MVP Kapil Batra. In this series you will find LWC tutorials from beginner to intermediate level.

So if you are working on it or planning to learn LWC then this video series is for you. Let's learn and grow together !

Please check complete code below from LWC Stack EP-27


HTML

1 2 3 4 5 6 7 8 9 10 11 12 13

{contact.fields.Name.value}

JS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19import { LightningElement, wire } from "lwc"; import { getListUi } from "lightning/uiListApi"; import CONTACT_OBJECT from "@salesforce/schema/Contact"; import NAME_FIELD from "@salesforce/schema/Contact.Name"; export default class WireListview extends LightningElement { @wire[getListUi, { objectApiName: CONTACT_OBJECT, listViewApiName: "Contact_test_view", sortBy: NAME_FIELD, pageSize: 10 }] listView; get contacts[] { return this.listView.data.records.records; } }

Output

Checkout complete tutorial below

If you have any question please leave a comment below.

If you would like to add something to this post please leave a comment below.
Share this blog with your friends if you find it helpful somehow !

Thanks

Happy Coding :]

Video liên quan

Chủ Đề