Commit 5bf55a44 authored by kpandey's avatar kpandey

Changes for to open dialog for delete

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@175727 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a8051b80
...@@ -3,6 +3,8 @@ import { Address } from './address.model'; ...@@ -3,6 +3,8 @@ import { Address } from './address.model';
import { IScreenEditor } from '../screen-editor'; import { IScreenEditor } from '../screen-editor';
import { AddressScreenComponent } from './address-screen/address-screen.component'; import { AddressScreenComponent } from './address-screen/address-screen.component';
import { ECMConfirmDialog } from '../../ecm-view/ecm-cart/ecm-cart.component';
import { MdDialog, MdDialogRef } from '@angular/material';
@Component({ @Component({
selector: 'address-manager', selector: 'address-manager',
...@@ -29,6 +31,8 @@ export class AddressEditor implements OnInit, IScreenEditor { ...@@ -29,6 +31,8 @@ export class AddressEditor implements OnInit, IScreenEditor {
newAddress : Address; newAddress : Address;
oldAddress : Address; oldAddress : Address;
showAdd : boolean = false; showAdd : boolean = false;
constructor( public dialog: MdDialog ) {}
ngOnInit(){ ngOnInit(){
console.log("ID", this.editorId ); console.log("ID", this.editorId );
...@@ -81,6 +85,23 @@ export class AddressEditor implements OnInit, IScreenEditor { ...@@ -81,6 +85,23 @@ export class AddressEditor implements OnInit, IScreenEditor {
remove(){ remove(){
this.onDelete.emit(this.address); this.onDelete.emit(this.address);
} }
confirmDialog( item: any ) {
let dialogRef = this.dialog.open( ECMConfirmDialog, {
width: '300px',
height: '180px',
disableClose: true
});
dialogRef.componentInstance.dialogTitle = "Remove Address ?";
dialogRef.componentInstance.cancelText = "No";
dialogRef.componentInstance.confirmText = "Yes";
dialogRef.afterClosed().subscribe( result => {
if ( result == 'true' ) {
this.onDelete.emit( this.address );
}
});
}
simpleClone(obj: any) { simpleClone(obj: any) {
return Object.assign({}, obj); return Object.assign({}, obj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment