File

device-grid/device-grid.component.ts

Implements

OnDestroy ProductExperienceEventSource

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(deviceGridService: DeviceGridService)
Parameters :
Name Type Optional
deviceGridService DeviceGridService No

Inputs

actionControls
Type : ActionControl[]

Sets action controls (actions available for individual items). If not given, it defaults to standard actions.

activeClassName
Type : string
Default value : 'active'

Sets the class name used for active rows (last clicked). Set empty string to disable appending active class to grid rows.

baseQuery
Type : object
Default value : {}

Sets the base query which is appended to the request for data.

bulkActionControls
Type : BulkActionControl[]

Sets bulk action controls (actions available for items selected by user). If not given, it defaults to standard bulk actions.

childDeviceGrid
Type : boolean
Default value : false
columns
Type : Column[]
Default value : this.deviceGridService.getDefaultColumns()

The list of columns to be displayed in the grid. If not given, it defaults to standard columns.

dataCallback
Type : DataCallback

Optional callback function that allows to modify server side data result before it's rendered.

headerActionControls
Type : HeaderActionControl[]

Sets header action controls (actions available from the grid header). If not given, it defaults to empty list of actions.

infiniteScroll
Type : LoadMoreMode

Sets load more mode.

legacyConfigKey
Type : string
legacyFilterKey
Type : string
loadingItemsLabel
Type : string
Default value : gettext('Loading devices…')

The label for loading indicator.

loadMoreItemsLabel
Type : any
Default value : gettext('Load more devices')

The label for load more button.

pagination
Type : Pagination

Pagination settings, e.g. allows for setting current page or page size. If not given, defaults to standard settings.

parentDeviceId
Type : string
refresh
Type : EventEmitter<void>
Default value : new EventEmitter()

Takes an event emitter. When an event is emitted, the grid will be reloaded.

selectable
Type : boolean
Default value : false

Determines whether items can be selected by clicking a checkbox in the first column.

showSearch
Type : boolean
Default value : true

Enables the search for devices where any device propery is matched agains the search term. Enabled by default. This input does not take effect if the childDeviceGrid input is set to true

singleSelection
Type : boolean
Default value : false

Restricts selection to a single row only. Selection column displays radio button instead of checkboxes

title
Type : string
Default value : gettext('Devices')

The title for the data grid, it's displayed in the grid's header.

withChildren
Type : boolean
Default value : false

Sets the withChildren query which is appended to the request.

Outputs

itemsSelect
Type : EventEmitter

Emits an event when items selection changes. The array contains ids of selected items.

onColumnsChange
Type : EventEmitter<Column[]>

Emits an event when columns configuration changes.

onDeviceQueryStringChange
Type : EventEmitter<string>
onFilterChange
Type : EventEmitter<FilterConfig[]>

Methods

ngOnDestroy
ngOnDestroy()
Returns : void
Async onDataSourceModifier
onDataSourceModifier(dataSourceModifier: DataSourceModifier)
Parameters :
Name Type Optional
dataSourceModifier DataSourceModifier No
trackByName
trackByName(_index, column: Column)
Parameters :
Name Type Optional
_index No
column Column No
Returns : string
updateFiltering
updateFiltering(columnNames: string[], action: literal type)
Parameters :
Name Type Optional
columnNames string[] No
action literal type No
Returns : void

Properties

actionControls
Type : ActionControl[]
Default value : []
appliedFilters
Type : FilterConfig[]
Default value : []
bulkActionControls
Type : BulkActionControl[]
Default value : this.deviceGridService.getDefaultBulkActionControls()
dataGrid
Type : DataGridComponent
Decorators :
@ViewChild(DataGridComponent, {static: true})
Public deviceGridService
Type : DeviceGridService
headerActionControls
Type : HeaderActionControl[]
Default value : this.deviceGridService.getDefaultHeaderActionControls()
infiniteScroll
Type : LoadMoreMode
noDataMessage
Default value : gettext('No devices to display.')
noResultsMessage
Default value : gettext('No matching devices.')
noResultsSubtitle
Default value : gettext('Refine your search terms')
pagination
Type : Pagination
Default value : this.deviceGridService.getDefaultPagination()
productExperienceEvent
Type : ProductExperienceEvent
serverSideDataCallback
Type : ServerSideDataCallback

Accessors

_pagination
set_pagination(value: Pagination)

Pagination settings, e.g. allows for setting current page or page size. If not given, defaults to standard settings.

Parameters :
Name Type Optional
value Pagination No
Returns : void
_infiniteScroll
set_infiniteScroll(infiniteScroll: LoadMoreMode)

Sets load more mode.

Parameters :
Name Type Optional
infiniteScroll LoadMoreMode No
Returns : void
_actionControls
set_actionControls(value: ActionControl[])

Sets action controls (actions available for individual items). If not given, it defaults to standard actions.

Parameters :
Name Type Optional
value ActionControl[] No
Returns : void
_bulkActionControls
set_bulkActionControls(value: BulkActionControl[])

Sets bulk action controls (actions available for items selected by user). If not given, it defaults to standard bulk actions.

Parameters :
Name Type Optional
value BulkActionControl[] No
Returns : void
_headerActionControls
set_headerActionControls(value: HeaderActionControl[])

Sets header action controls (actions available from the grid header). If not given, it defaults to empty list of actions.

Parameters :
Name Type Optional
value HeaderActionControl[] No
Returns : void
<c8y-data-grid
  [title]="title"
  [loadMoreItemsLabel]="loadMoreItemsLabel"
  [loadingItemsLabel]="loadingItemsLabel"
  [columns]="columns"
  [pagination]="pagination"
  [infiniteScroll]="infiniteScroll"
  [actionControls]="actionControls"
  [selectable]="selectable"
  [singleSelection]="singleSelection"
  [bulkActionControls]="bulkActionControls"
  [serverSideDataCallback]="serverSideDataCallback"
  (itemsSelect)="itemsSelect.emit($event)"
  [refresh]="refresh"
  [showSearch]="showSearch && !childDeviceGrid"
  [headerActionControls]="headerActionControls"
  [activeClassName]="activeClassName"
  c8yProductExperience
  inherit
>
  <c8y-ui-empty-state
    [icon]="stats?.size > 0 ? 'search' : 'c8y-device-management'"
    [title]="stats?.size > 0 ? (noResultsMessage | translate) : (noDataMessage | translate)"
    [subtitle]="stats?.size > 0 ? (noResultsSubtitle | translate) : null"
    *emptyStateContext="let stats"
    [horizontal]="stats?.size > 0"
  ></c8y-ui-empty-state>

  <ng-container *ngFor="let column of columns; trackBy: trackByName">
    <c8y-column [name]="column.name"></c8y-column>
  </ng-container>
</c8y-data-grid>

results matching ""

    No results matching ""