1 import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
2 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3 import { RdpDataTableService } from '../../shared/rdp-data-table.service';
6 selector: 'rdp-rdp-data-table-edit',
7 templateUrl: './rdp-data-table-edit.component.html',
8 styleUrls: ['./rdp-data-table-edit.component.scss']
10 export class RdpDataTableEditComponent implements OnInit {
12 @Input() settings: any;
13 @Input() rowdata: any;
14 @Input() isEditMode: boolean;
15 @Output() passEntry: EventEmitter<any> = new EventEmitter();
16 modalPopupTitle: string;
18 public columnsInfoList = [];
20 constructor(public activeModal: NgbActiveModal, public rdpDataTableService: RdpDataTableService) { }
23 this.modalPopupTitle = "Edit";
25 this.selectedRowData = JSON.stringify(this.rowdata);
28 if (this.settings.modalPopupTitle) {
29 this.modalPopupTitle = this.settings.modalPopupTitle;
31 for (var index in this.settings.columns) {
32 this.columnsInfoList.push(this.settings.columns[index]);
38 this.passEntry.emit(this.rowdata);
39 this.activeModal.close();
42 columnDataChanged($event, columnTitle) {
43 this.rowdata[columnTitle] = $event;