listView component provides a simple, consistent tool to display lists of items.
This component only functions on the widget!
The following must be included in the
index.html file of the widget or service.
Before assigning behavior or loading items, the component must be initialized. Be sure to include a target container with a unique ID. This ID is passed to the listView constructor.
The following options are available:
enableAddButton: If true, A floating add button is rendered.
The following methods are available:
Takes in an array of items, and loads them into the list view. See item structure. This method replaces all existing items
Appends a single item to the List View. See item structure.
The following event handlers can be assigned:
Triggered when the add button is clicked.
Triggered when an item is clicked. Passes the item in as the parameter.
Triggered when an item's action is clicked. Passes the item in as the parameter.
Each item has the following properties:
id- Unique ID
title- Title of the item
imageUrl- Renders as the item's image
subtitle- Renders as a subtitle below the title
description- Optional description
icon- Icon classList to render as the action icon
data- Optional item data, does not render.
An item's data can be changed. Once a change is made, calling
item.update() will update the item.