projects/k-components/src/lib/directives/activerowgridselection.directive.ts
Selector | [activeRowGridSelection] |
Properties |
Inputs |
Outputs |
constructor(host: GridComponent)
|
||||||
Parameters :
|
activeRowToBind | |
Type : any
|
|
activeRowToBindChange | |
Type : EventEmitter<any>
|
|
activeRowToBind |
Decorators :
@Input()
|
activeRowToBindChange |
Type : EventEmitter<any>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
import { Directive, Input, Output, EventEmitter } from '@angular/core';
import { SelectionEvent, GridComponent } from '@progress/kendo-angular-grid';
@Directive({
selector: '[activeRowGridSelection]',
})
export class ActiveRowGridSelection {
@Input()
activeRowToBind;
@Output()
activeRowToBindChange: EventEmitter<any> = new EventEmitter();
constructor(private host: GridComponent) {
host.selectionChange.subscribe((ev: SelectionEvent) => {
if (ev && ev.selectedRows && ev.selectedRows.length) {
this.activeRowToBindChange.emit(ev.selectedRows[0].dataItem);
}
});
}
}