Lurch web app user interface

Class

ListItem

An item that can be used in a Dialog and shows up as a list of one-line items with HTML contents (each one a DIV with a light border). Items can be selected, clicked, or double-clicked, and handlers can be added for each such situation. The value of the item is the selected item's value, or undefined if no item is selected.

It supports several event handlers that users can implement by defining functions with the following names on the instance they create:

  • onClick(value) - called when the item is clicked, with the item's value as the one parameter
  • onDoubleClick(value) - called when the item is double-clicked, with the item's value as the one parameter
  • onSelectionChanged() - called when the selection changes, no parameters passed
  • onTextShown() - called after repopulating the list with plain text, because a client called showText()
  • onListShown() - called after repopulating the list with items, because a client called showList()

Constructor

new ListItem()

Construct a new list item. Later you can either fill it with items, by calling showList(), or fill it with plain text (e.g., as a temporary message like "Loading..." or a message like "No items to show") by calling showText().

Source

Classes

ListItem

Methods

setSelectable(on)

Switch the mode of this item to permit selecting items (on true) or not permit selecting items (on false). Turning this off removes the current selection, if there is one.

Parameters

  • on boolean true

    whether items are selectable

Source