summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-cell-editor/rdp-radio-editor/rdp-radio-editor.component.ts
blob: e459c20c255638f4e34154b5cf09c832c5239023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Component, OnInit, Input , EventEmitter, Output} from '@angular/core';
import { MatRadioButton, MatRadioChange } from '@angular/material';

@Component({
  selector: 'rdp-radio-editor',
  templateUrl: './rdp-radio-editor.component.html',
  styleUrls: ['./rdp-radio-editor.component.scss']
})
export class RdpRadioEditorComponent implements OnInit {
  @Input() rowdata :any;
  @Input() columntitle: any
  @Input() data: any[];
  @Output() changedColumnValue = new EventEmitter<any>();
  columnValue: any;
  selectedValue : any;
  
  constructor() { }

  ngOnInit() {
    if (this.rowdata != null || this.rowdata != undefined) {
      let rowObj = JSON.parse(this.rowdata);
      let column = this.columntitle;
      this.columnValue = rowObj[column];
      
    } else {
      this.columnValue = null;
    }
    this.selectedValue = this.columnValue;
    console.log(" this.selected :::", this.selectedValue);
  }

  onChange(changedValue){
    this.changedColumnValue.emit(changedValue.value);
  }

}