File

projects/k-components/src/lib/directives/activerowgridselection.directive.ts

Metadata

Selector [activeRowGridSelection]

Index

Properties
Inputs
Outputs

Constructor

constructor(host: GridComponent)
Parameters :
Name Type Optional
host GridComponent No

Inputs

activeRowToBind
Type : any

Outputs

activeRowToBindChange
Type : EventEmitter<any>

Properties

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);
      }
    });
  }
}

result-matching ""

    No results matching ""