device-grid/device-grid.component.ts
OnInit
OnChanges
OnDestroy
GridConfigContextProvider
providers |
{
provide: DATA_GRID_CONFIGURATION_STRATEGY, useClass: UserPreferencesConfigurationStrategy
}
{
provide: DATA_GRID_CONFIGURATION_CONTEXT_PROVIDER, useExisting: DeviceGridComponent
}
|
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 : Column[]
|
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. |
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 |
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<Column[]>
|
Emits an event when columns configuration changes. |
onDeviceQueryStringChange |
Type : EventEmitter<string>
|
onFilterChange |
Type : EventEmitter<FilterConfig[]>
|
getGridConfigContext |
getGridConfigContext()
|
Returns :
UserPreferencesGridConfigContext
|
ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
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
|
Async setActionControls |
setActionControls()
|
Returns :
any
|
trackByName | |||||||||
trackByName(_index, column: Column)
|
|||||||||
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 : Column[]
|
Default value : 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"
[pagination]="pagination"
[infiniteScroll]="infiniteScroll"
[actionControls]="actionControls"
[selectable]="selectable"
[bulkActionControls]="bulkActionControls"
[serverSideDataCallback]="serverSideDataCallback"
(itemsSelect)="itemsSelect.emit($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; trackBy: trackByName">
<c8y-column [name]="column.name"></c8y-column>
</ng-container>
</c8y-data-grid>