Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ListComponent

List component

For items, use a template named itemTemplate to contain content for each item. For each item in the items array, the expansion can be disabled by setting disabled to true on the item. If using actions, use a template named actionTemplate to contain expandable content for the actions of each item. If using expand items, use a template named itemExpandedTemplate to contain expandable content for each item.

Cannot use both multi-select and double click selection at the same time Cannot use both checkbox and click selection at the same time

Unique IDs are generated for each list item, which can be overridden by providing an id for the pfng-list tag.

Usage:
import { BasicListModule } from 'patternfly-ng/list';

Or:
import { BasicListModule } from 'patternfly-ng';

Hierarchy

Implements

  • DoCheck
  • OnInit

Index

Constructors

constructor

Properties

actionHeadingTemplate

actionHeadingTemplate: TemplateRef<any>

The name of the template containing action heading layout

actionTemplate

actionTemplate: TemplateRef<any>

The name of the template containing actions for each item

config

config: ListConfig

The list config containing component properties

expandTemplate

expandTemplate: TemplateRef<any>

The name of the template used to contain expandable content for each item

itemHeadingTemplate

itemHeadingTemplate: TemplateRef<any>

The name of the template containing item heading layout

itemTemplate

itemTemplate: TemplateRef<any>

The name of the template containing item layout

items

items: any[]

An array of items to display in the list

onActionSelect

onActionSelect: EventEmitter<Object> = new EventEmitter()

The event emitted when an action (e.g., button, kebab, etc.) has been selected

onClick

onClick: EventEmitter<Object> = new EventEmitter()

The event emitted when an item has been clicked

onDblClick

onDblClick: EventEmitter<Object> = new EventEmitter()

The event emitted when an item is double clicked

onPinChange

onPinChange: EventEmitter<Object> = new EventEmitter()

The event emitted when an item pin has been changed

onSelectionChange

onSelectionChange: EventEmitter<Object> = new EventEmitter()

The event emitted when an item selection has been changed

Accessors

itemsEmpty

  • get itemsEmpty(): boolean

Methods

Protected checkboxChange

  • checkboxChange(item: any): void

Protected dblClick

  • dblClick($event: MouseEvent, item: any): void
  • Helper to generate double click event

    Parameters

    • $event: MouseEvent

      The triggered event

    • item: any

      The double clicked item

    Returns void

Protected deselectItems

  • deselectItems(items: any[]): void

Protected getConfig

Protected getId

  • getId(suffix: string, index: number): string
  • Return an ID for the given element prefix and index (e.g., 'pfng-list1-item0')

    Note: The ID prefix can be overridden by providing an id for the pfng-list tag.

    Parameters

    • suffix: string

      The element suffix (e.g., 'item')

    • index: number

      The current item index

    Returns string

Protected getSelectedItems

  • getSelectedItems(items: any[]): any[]

Protected handleAction

  • handleAction(action: Action): void

ngDoCheck

  • ngDoCheck(): void

ngOnInit

  • ngOnInit(): void

Protected radioButtonChange

  • radioButtonChange(item: any): void

selectItem

  • selectItem(item: any, selected: boolean): void
  • Select or deselect an item

    Parameters

    • item: any

      The item to select or deselect

    • selected: boolean

      True if item should be selected

    Returns void

Protected selectSingleItem

  • selectSingleItem(item: any): void

Protected setupConfig

  • setupConfig(): void

Protected toggleSelection

  • toggleSelection($event: MouseEvent, item: any): void

Generated using TypeDoc