Advertisement
baree2008

function popup

Jun 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // itemview typescript
  2.  
  3. // functions popup
  4.   functionsListDataSource : object[] = [{"listName":"exampleFuntionName"}];
  5.   popupListFunctionsVisible : boolean = false ;
  6.  
  7.  
  8. onFunctionBtnClick(){
  9.     this.popupListFunctionsVisible = true;
  10.   }
  11.  
  12.   onFunctionsListSelectItem(e){
  13.     let funcName : string  = e.itemData.listName ;
  14.  
  15.     switch(funcName){
  16.       case "exampleFuntionName":
  17.       this.exampleFuntion();
  18.       break;
  19.     }
  20.    
  21.   }
  22.  
  23.   exampleFuntion(){
  24.     var result = confirm("Are you sure you want to execute function?", "Confirm execute");
  25.     result.then((dialogResult) => {
  26.         if(dialogResult){
  27.          // to do when confirm
  28.      }
  29.     });
  30.   }
  31. // itemview html
  32.  
  33. <app-list-with-search-bar
  34.          [dataSource]="functionsListDataSource"
  35.          (selectItem)="onFunctionsListSelectItem($event)"
  36.          [(popupVisible)]="popupListFunctionsVisible">
  37. </app-list-with-search-bar>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement