-
Notifications
You must be signed in to change notification settings - Fork 1
IdeaListViewComponent HTML
Ethan Dunzer edited this page Aug 29, 2024
·
1 revision
The HTML template for the IdeaListViewComponent is responsible for rendering a list of ideas in a table format. It supports features like sorting, filtering, pagination, and user interaction for upvoting and downvoting ideas. The template leverages lightning-datatable for displaying the list of ideas and lightning-button components for pagination controls.
Data Table
-
lightning-datatable
: Displays the list of ideas with columns for subject, product, status, upvote, and downvote actions. - Conditional Rendering: The table is only rendered if there are ideas to display, ensuring that the UI is clean and responsive.
Pagination Controls
- Previous Button: Allows users to navigate to the previous page of ideas. This button is disabled on the first page.
- Next Button: Allows users to navigate to the next page of ideas. This button is disabled when on the last page.
- Page Indicator: Displays the current page number and the total number of pages.
Properties
- ideas: The list of ideas to be displayed in the table.
- columns: Defines the columns of the datatable, including subject, product, status, upvote, and downvote buttons.
- page: Tracks the current page number.
- totalPage: Tracks the total number of pages available based on the data.
Elements
- lightning-datatable: The primary component for displaying the list of ideas in a table format.
- lightning-button: Used for pagination controls to navigate through pages of ideas.
- lightning-layout: Provides structure for the pagination controls, ensuring they are aligned and styled correctly.
Conditional Rendering
- Pagination Controls: Only displayed if there is more than one page of ideas.
- Data Table: Displayed only when there are ideas available to show.
Usage The template is designed to work with the JavaScript logic to provide a dynamic and responsive interface for managing and interacting with ideas. It ensures that users can easily navigate through a large set of ideas, upvote or downvote them, and stay informed about the current page they are on.