Skip to content

Commit

Permalink
fix(#204): Duplication issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AudreyLR authored and philipperobertgh committed Nov 26, 2018
1 parent 7c878ca commit 8350c5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[rowAlternationEnabled]="true"
(onInitNewRow)="onInitNewRow($event)"
(onRowInserting)="onRowInserting($event)"
(onEditingStart)="onEditingStart($event)"
(onRowUpdated)="onRowUpdated($event)"
(onRowRemoved)="onRowRemoved($event)">
<dxi-column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class SelectTemplateComponent implements OnInit {
templateIdentifiers: ConfigurationTemplate[];
isOpenDisabled: boolean;
angularIsLoaded = false;
editedTemplate: ConfigurationTemplate;

constructor(
private formBuilder: FormBuilder,
Expand Down Expand Up @@ -58,14 +59,26 @@ export class SelectTemplateComponent implements OnInit {

onInitNewRow(e) {
e.data = new ConfigurationTemplate();
e.data.data = '';
e.data.isActive = true;
}
}

onRowInserting(e){
this.saveTemplate(e.data);
}

onEditingStart(e){
this.editedTemplate = new ConfigurationTemplate();
this.editedTemplate.id = e.data.id;
this.editedTemplate.isActive = e.data.isActive;
this.reportConfigurationService.getTemplate(e.data.id).subscribe( res => {
this.editedTemplate.data = res.data;
});
}

onRowUpdated(e){
this.editedTemplate.name = e.data.name;
e.data = this.editedTemplate;
this.saveTemplate(e.data);
}

Expand Down

0 comments on commit 8350c5b

Please sign in to comment.