File

device-grid/device-grid.component.ts

Implements

OnInit

Metadata

selector c8y-device-grid
templateUrl ./device-grid.component.html

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

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

Inputs

actionControls

Type : []

baseQuery

Type : any

Default value : {}

bulkActionControls

Type : []

childDeviceGrid

Type : boolean

Default value : false

columns

Type : []

dataCallback

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

Type : DataCallback

infiniteScroll
loadingItemsLabel

Type : string

Default value : gettext('Loading devices…')

loadMoreItemsLabel

Default value : gettext('Load more devices')

pagination
parentDeviceId

Type : string

refresh

Type : EventEmitter<any>

selectable

Type : boolean

Default value : false

showChildDevices

Determines if additional "Show child devices" toggle should be shown and in what state it should be.

Type : literal type

Default value : { show: false, value: false }

title

Type : string

Default value : gettext('Devices')

Outputs

itemsSelect $event Type: EventEmitter
onChildDevices $event Type: EventEmitter
onColumnsChange

Emits an event when columns configuration changes.

$event Type: EventEmitter<DeviceGridColumn[]>
onDeviceQueryStringChange $event Type: EventEmitter<string>

Methods

configChange
configChange(config: GridConfig)
Parameters :
Name Type Optional
config GridConfig No
Returns : void
ngOnInit
ngOnInit()
Returns : void
Async onDataSourceModifier
onDataSourceModifier(dataSourceModifier: DataSourceModifier)
Parameters :
Name Type Optional
dataSourceModifier DataSourceModifier No
Async onDeleteDevice
onDeleteDevice(device)
Parameters :
Name Optional
device No
Returns : any
Async setActionControls
setActionControls()
Returns : any
trackByName
trackByName(_index, column: DeviceGridColumn)
Parameters :
Name Type Optional
_index No
column DeviceGridColumn 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
actionControls: ActionControl[]
Type : ActionControl[]
Default value : []
bulkActionControls
bulkActionControls: BulkActionControl[]
Type : BulkActionControl[]
Default value : this.deviceGridService.getDefaultBulkActionControls()
columns
columns: DeviceGridColumn[]
Type : DeviceGridColumn[]
Default value : this.deviceGridService.getDefaultColumns()
dataGrid
dataGrid: DataGridComponent
Type : DataGridComponent
Decorators :
@ViewChild(DataGridComponent, {static: undefined})
Public deviceGridService
deviceGridService: DeviceGridService
Type : DeviceGridService
infiniteScroll
infiniteScroll: LoadMoreMode
Type : LoadMoreMode
pagination
pagination: Pagination
Type : Pagination
Default value : this.deviceGridService.getDefaultPagination()
serverSideDataCallback
serverSideDataCallback: any
Type : any
withChildren
withChildren: boolean
Type : boolean
Default value : false

Accessors

_columns
set_columns(value: [])
Parameters :
Name Type Optional
value [] No
Returns : void
_pagination
set_pagination(value)
Parameters :
Name Optional
value No
Returns : void
_infiniteScroll
set_infiniteScroll(infiniteScroll)
Parameters :
Name Optional
infiniteScroll No
Returns : void
_actionControls
set_actionControls(value: [])
Parameters :
Name Type Optional
value [] No
Returns : void
_bulkActionControls
set_bulkActionControls(value: [])
Parameters :
Name Type Optional
value [] No
Returns : void
<c8y-data-grid
  [title]="title"
  [loadMoreItemsLabel]="loadMoreItemsLabel"
  [loadingItemsLabel]="loadingItemsLabel"
  [columns]="columns"
  [pagination]="pagination"
  [infiniteScroll]="infiniteScroll"
  [actionControls]="actionControls"
  [selectable]="selectable"
  [bulkActionControls]="bulkActionControls"
  [serverSideDataCallback]="serverSideDataCallback"
  (itemsSelect)="itemsSelect.emit($event)"
  (onConfigChange)="configChange($event)"
  [refresh]="refresh"
  [showChildDevices]="showChildDevices"
  (onChildDevices)="withChildren = $event; onChildDevices.emit($event)"
>
  <div class="c8y-empty-state">
    <h1 c8yIcon="search"></h1>
    <div>
      <p>
        <strong>{{ 'No matching devices.' | translate }}</strong>
      </p>
      <small>{{ 'Refine your search terms' | translate }}</small>
    </div>
  </div>
  <ng-container *ngFor="let column of columns; trackBy: trackByName">
    <c8y-column [name]="column.name"></c8y-column>
  </ng-container>
</c8y-data-grid>

result-matching ""

    No results matching ""