Skip to content

WorkListViewComponent HTML

Ethan Dunzer edited this page Aug 29, 2024 · 1 revision

Overview

The HTML template for the WorkListViewComponent is responsible for displaying a list of work records within a Salesforce application. It uses Lightning Web Components (LWC) to render a Lightning Datatable with pagination controls, enabling users to navigate through multiple pages of work records.

Structure

Lightning Card: The main container that holds the entire component, titled "My Work Items." Lightning Datatable: Displays the work records in a tabular format, allowing for interaction with individual records. Pagination Controls: Positioned below the datatable, enabling navigation between pages of records.

Properties

workRecords: The list of work records displayed in the datatable. columns: Defines the columns and the data fields to be displayed in the datatable.

Elements

Datatable:

  • Displays records in a structured format, allowing for row selection and interaction.
  • The key-field attribute is used to uniquely identify each record.

Pagination Controls:

  • Previous Button: Allows users to navigate to the previous page. Disabled when on the first page.
  • Next Button: Allows users to navigate to the next page. Disabled when on the last page.
  • Page Indicator: Displays the current page number and the total number of pages.

Conditional Rendering

  • Datatable Visibility: The datatable is only rendered when there are records to display.
  • Error Handling: Error messages are displayed if there is an issue fetching the records.
  • Pagination Visibility: Pagination controls are rendered when there are multiple pages of records.

Usage

The template works alongside the JavaScript code to display work records dynamically, with pagination controls allowing users to navigate through records. It ensures that the UI is responsive and updates based on user interactions and the state of the data.

Clone this wiki locally