device-grid/device-grid.component.ts
| selector | c8y-device-grid |
| templateUrl | ./device-grid.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(deviceGridService: DeviceGridService)
|
||||||
|
Parameters :
|
| actionControls |
Type : []
|
|
Sets action controls (actions available for individual items). If not given, it defaults to standard actions. |
| baseQuery |
Type : any
|
Default value : {}
|
|
Sets the base query which is appended to the request for data. |
| bulkActionControls |
Type : []
|
|
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 : DeviceGridColumn[]
|
|
The list of columns to be displayed in the grid. If not given, it defaults to standard columns. |
| columnsConfigKey |
Type : string
|
|
The name of the key where columns configuration will be stored. |
| dataCallback |
Type : DataCallback
|
|
Optional callback function that allows to modify server side data result before it's rendered. |
| headerActionControls |
Type : []
|
|
Sets header action controls (actions available from the grid header). If not given, it defaults to empty list of actions. |
| infiniteScroll |
|
Sets load more mode. |
| 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 |
|
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<any>
|
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. |
| 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. |
| itemsSelect |
Type : EventEmitter
|
|
Emits an event when items selection changes. The array contains ids of selected items. |
| onColumnsChange |
Type : EventEmitter<DeviceGridColumn[]>
|
|
Emits an event when columns configuration changes. |
| onDeviceQueryStringChange |
Type : EventEmitter<string>
|
| onFilterChange |
Type : EventEmitter<FilterConfig[]>
|
| addCustomColumn | ||||||
addCustomColumn(columnConfig: CustomColumnConfig)
|
||||||
|
Parameters :
Returns :
void
|
| configChange | ||||||
configChange(config: GridConfig)
|
||||||
|
Parameters :
Returns :
void
|
| filterChange | |||
filterChange(undefined)
|
|||
|
Parameters :
Returns :
void
|
| ngOnDestroy |
ngOnDestroy()
|
|
Returns :
void
|
| ngOnInit |
ngOnInit()
|
|
Returns :
void
|
| Async onDataSourceModifier | ||||||
onDataSourceModifier(dataSourceModifier: DataSourceModifier)
|
||||||
|
Parameters :
Returns :
Promise<ServerSideDataResult>
|
| onDeleteDevice | ||||
onDeleteDevice(device)
|
||||
|
Parameters :
Returns :
void
|
| removeCustomColumn | ||||||
removeCustomColumn(columnToRemove: Column)
|
||||||
|
Parameters :
Returns :
void
|
| Async setActionControls |
setActionControls()
|
|
Returns :
any
|
| trackByName | |||||||||
trackByName(_index, column: DeviceGridColumn)
|
|||||||||
|
Parameters :
Returns :
string
|
| updateFiltering | |||||||||
updateFiltering(columnNames: string[], action: literal type)
|
|||||||||
|
Parameters :
Returns :
void
|
| actionControls |
Type : ActionControl[]
|
Default value : []
|
| appliedFilters |
Type : FilterConfig[]
|
Default value : []
|
| bulkActionControls |
Type : BulkActionControl[]
|
Default value : this.deviceGridService.getDefaultBulkActionControls()
|
| columns$ |
Type : Observable<DeviceGridColumn[]>
|
Default value : of(this.deviceGridService.getDefaultColumns())
|
| configureColumnsEnabled |
Type : boolean
|
Default value : true
|
| dataGrid |
Type : DataGridComponent
|
Decorators :
@ViewChild(DataGridComponent, {static: true})
|
| Public deviceGridService |
Type : DeviceGridService
|
| headerActionControls |
Type : HeaderActionControl[]
|
Default value : this.deviceGridService.getDefaultHeaderActionControls()
|
| infiniteScroll |
Type : LoadMoreMode
|
| pagination |
Type : Pagination
|
Default value : this.deviceGridService.getDefaultPagination()
|
| serverSideDataCallback |
Type : any
|
| _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 :
Returns :
void
|
| _infiniteScroll | ||||||
set_infiniteScroll(infiniteScroll: LoadMoreMode)
|
||||||
|
Sets load more mode.
Parameters :
Returns :
void
|
| _actionControls | ||||||
set_actionControls(value: ActionControl[])
|
||||||
|
Sets action controls (actions available for individual items). If not given, it defaults to standard actions.
Parameters :
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 :
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 :
Returns :
void
|
<c8y-data-grid
[title]="title"
[loadMoreItemsLabel]="loadMoreItemsLabel"
[loadingItemsLabel]="loadingItemsLabel"
[columns]="columns$ | async"
[pagination]="pagination"
[infiniteScroll]="infiniteScroll"
[actionControls]="actionControls"
[selectable]="selectable"
[bulkActionControls]="bulkActionControls"
[serverSideDataCallback]="serverSideDataCallback"
(itemsSelect)="itemsSelect.emit($event)"
(onConfigChange)="configChange($event)"
(onAddCustomColumn)="addCustomColumn($event)"
(onRemoveCustomColumn)="removeCustomColumn($event)"
(onFilter)="filterChange($event)"
[refresh]="refresh"
[headerActionControls]="headerActionControls"
[configureColumnsEnabled]="configureColumnsEnabled"
>
<c8y-ui-empty-state
[icon]="'search'"
[title]="'No matching devices.' | translate"
[subtitle]="'Refine your search terms' | translate"
[horizontal]="true"
>
</c8y-ui-empty-state>
<ng-container *ngFor="let column of columns$ | async; trackBy: trackByName">
<c8y-column [name]="column.name"></c8y-column>
</ng-container>
</c8y-data-grid>