UNPKG

@progress/kendo-angular-grid

Version:

Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.

54 lines (53 loc) 2.13 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { EditingDirectiveBase } from './editing-directive-base'; import { LocalRowEditService } from './local-row-edit.service'; import { Directive } from '@angular/core'; import * as i0 from "@angular/core"; /** * @hidden */ export class RowEditingDirectiveBase extends EditingDirectiveBase { rowIndex; /** * @hidden */ ngOnInit() { super.ngOnInit(); this.subscriptions .add(this.grid.edit.subscribe(this.editHandler.bind(this))); } createDefaultService() { return new LocalRowEditService(this.grid, this.localDataChangesService); } addHandler() { this.closeEditor(); super.addHandler(); } editHandler(args) { this.closeEditor(); this.rowIndex = args.rowIndex; this.grid.editRow(args.rowIndex, this.createModel(args)); } saveHandler(args) { super.saveHandler(args); this.clean(); } closeEditor(rowIndex = this.rowIndex) { super.closeEditor(rowIndex); this.clean(); } clean() { delete this.rowIndex; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RowEditingDirectiveBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RowEditingDirectiveBase, selector: "[kendoGridRowEditingDirectiveBase]", usesInheritance: true, ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RowEditingDirectiveBase, decorators: [{ type: Directive, args: [{ selector: '[kendoGridRowEditingDirectiveBase]' }] }] });