当我单击取消按钮时,如何重置掉落的数据? (两个表之间的角度材质拖放)

时间:2019-06-19 11:52:05

标签: angular angular7

在第一张表中的两个表之间到第二张表之间的数据删除,但是当我单击“取消”按钮时,如何重置表。表示当我单击“点击”按钮时,所有提交的数据在提交按钮被重置之前都会被重置。

dropUser(event: CdkDragDrop<string[]>) {  
    if (event.previousContainer === event.container){
      moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
    } else {
      transferArrayItem(event.previousContainer.data,event.container.data,event.previousIndex,event.currentIndex);

      this.uList_new_add_data = event.container.data[event.currentIndex]; //find added data
      // create array of added data
      if(this.uList_new_add_dataA.length <= 0){
        this.uList_new_add_dataA[0] = this.uList_new_add_data;
      }else{
        this.uList_new_add_dataA[this.uList_new_add_dataA.length] = this.uList_new_add_data;
      }
      //console.log(this.uList_new_add_dataA,"user list added data");
      // if it is already in this departmet
      let x = this.uList_new_add_data;
      let alldata = this.new_User;
      console.log(alldata);      
    }
  }
  // call when data droped in call
  dropCallDept(event: CdkDragDrop<string[]>) {
    if (event.previousContainer === event.container){
      moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
    } else {
      transferArrayItem(event.previousContainer.data,event.container.data,event.previousIndex,event.currentIndex);      
      this.callList_new_add_data = event.container.data[event.currentIndex]; //find added data
      // create array of added data
      if(this.callD_new_add_dataA.length <= 0){
        this.callD_new_add_dataA[0] = this.callList_new_add_data;
      }else{
        this.callD_new_add_dataA[this.callD_new_add_dataA.length] = this.callList_new_add_data;
      }
      //console.log(this.callD_new_add_dataA,"call-D added data");
      let y = this.client_Department;
      console.log(y);
    }
  }

0 个答案:

没有答案