ejsdropdown button select event not working

Hi, We implement ejsdropdown button code with select event not working i am providing code below.

Code in Bold statement is my problem statement.

please find attached code below

import { Component, OnInit, ViewChild } from '@angular/core';
import { Column, ContextMenuOpenEventArgs, EditSettingsModel, FilterSettingsModel, GridComponent, GroupSettingsModel, RowSelectEventArgs, ToolbarItems } from '@syncfusion/ej2-angular-grids';
import { ClickEventArgs, ItemModel } from '@syncfusion/ej2-angular-navigations';
import { MastertrackercreatorService } from '../../../service/data/mastertrackercreator.service';
import { COMPANY_ID } from '../../companylist/companylist.component';
import * as fileSaver from 'file-saver';
import { BatchocrService } from '../../../service/data/batchocr.service';
import { ExtractionserviceService } from '../../../service/data/extractionservice.service';
import { FileContent } from '../../master-tracker-creator/master-tracker-creator.component';
import { search } from '@syncfusion/ej2-filemanager';
import { ToolServiceService } from '../../../service/data/tool-service.service';
import { DialogComponent, DialogUtility } from '@syncfusion/ej2-angular-popups';
import { dialog } from '@syncfusion/ej2-angular-spreadsheet';
import { ContextMenuService, PageService, ContextMenuItemModel, ContextMenu } from '@syncfusion/ej2-angular-grids';
import { MenuEventArgs } from '@syncfusion/ej2-navigations';
import { ElementRef } from '@angular/core';
import { SelectionSettingsModel } from '@syncfusion/ej2-angular-grids';
import { Router } from '@angular/router';
import { DropDownList } from '@syncfusion/ej2-angular-dropdowns';
// import { PdfJsViewerComponent } from 'ng2-pdfjs-viewer';
export const COMPANY_NAME = 'companyName';
@Component({
  selector: 'app-master-file-tracker',
  templateUrl: './master-file-tracker.component.html',
  styleUrls: ['./master-file-tracker.component.css'],
  providers: [ContextMenuService, PageService]
})
export class MasterFileTrackerComponent implements OnInit {
  company_id = sessionStorage.getItem(COMPANY_ID);
  public pageSettings: Object;
  public pageSettings1: Object;

  fileObj: any;
  constructor(private masterTrackerCreatorService: MastertrackercreatorService, private batchocrService: BatchocrService, private toolService: ToolServiceService, private ExtractionserviceService: ExtractionserviceService, private router: Router) {
    this.pageSettings = { pageSizes: ['6', '8', '12', 'All'], };
    this.pageSettings1 = { pageSizes: ['2', '4', '8', 'All'], };
  }
  files = [];
  folderdata: any[];
  isLoading = false;
  public toolbar: ToolbarItems[] | object;
  data: any;
  data1: any;
  isShow: boolean = false;
  masterdata1: any;
  masterdataContent: any;
  masterdata: any[];
  fileNameList: any[];
  GroupList: any[];
  duplicateData: any[];
  duplicateStatus: any[];
  viewDocName: any[];
  markDuplicateReferenceId: number;
  arr = new Array<number>(2);
  duplicateReferenceId: number;
  ReferceId: any[];
  public groupOptions: GroupSettingsModel;
  viewDocumentName: string;
  name1: string;
  name: string;
  dataInZip: any;
  folderdataForSeg: any[];
  folderdataForExe: any[];
  public currentPdf: string = null;
  masterMatchUpAddendum: any;
  masterMatchUpAddendum1: any;
  public filterOptions: FilterSettingsModel = { type: 'Excel' };
  public dataIrrelevant: any;
  public selectedBatch: any = undefined;
  @ViewChild('toolbarTemplate')
  public toolbarTemplate: any;
  OCRBatchQuntity: boolean = false;
  newDBFiles: any;
  obj: any;
  // Drop down
  public dpParams: any;
  public elem: HTMLElement;
  public dropObj: DropDownList;
  parentReferenceDropDownData = [];
  parentReferenceDropDownData1 = [];
  isDisable: boolean = false;
  isDisableGrid: boolean = true;
  agreementTypeDatas = [];
  agreementTypeDatas1 = [];
  @ViewChild('matchupTemplateDialog') matchupTemplateDialog: DialogComponent;

  @ViewChild('toolbarTemplate11')
  public toolbarTemplate11: any;
  @ViewChild('grid') grid: GridComponent;
  @ViewChild('FindByNameTemplate') FindByNameTemplate: DialogComponent;
  @ViewChild('comparePDFTemplate') public comparePDFTemplate: DialogComponent;
  // @ViewChild('myPdfViewer1') public myPdfViewer1: PdfJsViewerComponent;
  // @ViewChild('myPdfViewer2') public myPdfViewer2: PdfJsViewerComponent;
  @ViewChild('container', { read: ElementRef }) container: ElementRef;
  @ViewChild('ejDialog') ejDialog: DialogComponent;
  @ViewChild('resultGrid') public ResultGrid: GridComponent;
  public selectOptions: SelectionSettingsModel;
  valueDropDown: string;
  @ViewChild('toolbarTemplates')
  public toolbarTemplates: any;
  @ViewChild('ejDialogForCreateBatch') ejDialogForCreateBatch: DialogComponent;
  @ViewChild('ejDialogForCreateBatches') ejDialogForCreateBatches: DialogComponent;
  @ViewChild('ejDialogForCreateBatchExecution') ejDialogForCreateBatchExecution: DialogComponent;

  // The Dialog shows within the target element.
  @ViewChild('containerForCreateBatches', { read: ElementRef }) containerForCreateBatches: ElementRef;
  @ViewChild('containerForCreateBatch', { read: ElementRef }) containerForCreateBatch: ElementRef;
  @ViewChild('containerForCreateBatchExecution', { read: ElementRef }) containerForCreateBatchExecution: ElementRef;
  public datadropdown: string[] = ['Master Tracker', 'Irrelevant Files', 'OCR',  'Segregation', 'Execution', 'Parent-Child Matchup'];
  public items: ItemModel[] = [
    {
      text: 'Duplicate By Name'
    },
    {
      text: 'Duplicate By Content'
    }
  ];

  showZeroMessage: boolean = false;
  showtotalFilesMessage: boolean = false;
  showZeroMessage1: boolean = false;
  showtotalFilesMessage1: boolean = false;

  showZeroMessageExecution: boolean = false;
  showtotalFilesMessageExecution: boolean = false;
  showZeroMessage1Execution: boolean = false;
  showtotalFilesMessage1Execution: boolean = false;
  public targetElement: HTMLElement;
  public editSettings: EditSettingsModel;
  public Seg: Object[] = []
  dBFiles: any = [];
  public contextMenuItems: ContextMenuItemModel[] = [{ text: 'Extract', target: '.e-content', id: 'Extract' },
  { text: 'View Files', target: '.e-content', id: 'View Files' },
  { text: 'View', target: '.e-content', id: 'View' },
  { text: 'Information', target: '.e-content', id: 'Information' },
  { text: 'Convert To Pdf', target: '.e-content', id: 'ConvertToPdf' },
  { text: 'Mark As Relevant', target: '.e-content', id: 'markAsRelevant' }
  ];

  ngOnInit() {
    alert('sfssdg')
    this.contextMenuItems = [{ text: 'Extract', target: '.e-content', id: 'Extract' },
    { text: 'View Files', target: '.e-content', id: 'View Files' },
    { text: 'Information', target: '.e-content', id: 'Information' },
    { text: 'Convert To Pdf', target: '.e-content', id: 'ConvertToPdf' },

    ];

    this.valueDropDown = 'Master Tracker'
    this.selectOptions = { type: 'Multiple' };
    this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true };
    this.toolbar = [
      { template: this.toolbarTemplate11 },
      { template: this.toolbarTemplates },
      // {
      //   text: 'View', tooltipText: 'view',
      //   id: 'view', align: 'Right'
      // },
      'ColumnChooser', 'Search',
      {
        text: 'Clear', tooltipText: 'Clear Search',
        prefixIcon: 'e-cancel', id: 'clear', align: 'Right'
      },
      {
        text: 'Update', tooltipText: 'Update',
        prefixIcon: 'e-save', id: 'Update', align: 'left'
      },
      // {
      //   text: 'Update Matchup', tooltipText: 'Update Matchup',
      //   id: 'Update Matchup', align: 'Left'
      // },


      { template: this.toolbarTemplate }




    ];

    setTimeout(() => {
      this.viewDataColumn();
    }, 1000);

    this.ReferceId = [];
    this.viewDocName = [];
    console.log("Line 186***************************");
    this.updateMasterTracker();
    var obj1: any;
//COMMENTED FOR TESTING PURPOSE
    // this.batchocrService.getListOfDBDocumentOcr().subscribe(
    //   (response1 => {
    //     console.log("response1:"+response1);
    //     this.data1 = response1['BatchingOCR'];
    //     for (let j = 0; j < this.data1.length; j++) {
    //       for (let k = 0; k < this.data1[j].batchingOCRFilename.length; k++) {
    //         obj1 = { "path": this.data1[j].batchingOCRFilename[k].filePath, "ocrStatus": this.data1[j].batchingOCRFilename[k].ocrstaus };
    //         this.dBFiles.push(obj1);
    //       }
    //       //  this.obj =this.newDBFiles
         

    //     }
    //   })
    // )
    console.log("Line 205***************************");
   this.getMasterTrackerData123();//commented at 12.37pm 11/20/2021
    this.parentRefrenceIdDropDown();
    this.getAgreementTypeDataForMasterMatchup();


  }

  getMasterTrackerData() {
    this.data = [];
    let arr: {};
    let obj = [];
    this.masterTrackerCreatorService.masterTrackerFileView(this.company_id).subscribe(
      response => {
        this.grid.hideSpinner();
        this.data = response['masterTracker'];
        var a = [];
        var b;
        var ocrstaus;
        if (this.data && this.dBFiles) {
          for (let n = 0; n < this.data.length; n++) {
            for (var j = 0; j < this.dBFiles.length; j++) {
              console.log(this.data[n].filePath+"*************this.data[n].filePaththis.data[n].filePath Line 227")
              console.log(this.dBFiles[j].path+"************this.dBFiles[j].paththis.dBFiles[j].path  line 228")
              if (this.data[n].filePath === this.dBFiles[j].path) {
                ocrstaus = this.dBFiles[j].ocrStatus;
              }
            }
            b = this.data[n].filePath;
            //FOR SERVER
           b = b.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID) + "/", "");
            //FOR local
           //  b = b.replace("C:\\AE_HOME\\Ftp_Location\\1\\", "");
            obj[n] = {
              "blId": this.data[n].blId, "filePath": b, "fileName": this.data[n].fileName, "date": this.data[n].date, "fileExtension": this.data[n].fileExtension, "fileType": this.data[n].fileType,
              "fileSizeInKb": this.data[n].fileSizeInKb, "OCRStatus": ocrstaus, "extractionSourceFolder": this.data[n].extractionSourceFolder, "extractionStatus": this.data[n].extractionStatus, "ConvertedStatus": this.data[n].convertedStatus
            }
            a.push(obj[n]);

          }
          this.data = a;
        }


      })

  }

  viewDataColumn() {

    let c: Column[] = this.grid.getColumns();
    c[0].visible = true;
    c[1].visible = true;
    c[2].visible = false;
    c[3].visible = true;
    c[4].visible = true;
    c[5].visible = true;
    c[6].visible = true;
    c[7].visible = true;
    c[8].visible = false;
    c[9].visible = true;
    c[10].visible = true;
    c[11].visible = true;
    c[12].visible = true;
    c[13].visible = true;
    c[14].visible = true;
    c[15].visible = false;
    c[16].visible = false;
    c[17].visible = false;
    c[18].visible = false;
    c[19].visible = false;
    c[20].visible = false;
    c[21].visible = false;
    c[22].visible = false;
    c[23].visible = false;
    c[24].visible = true;
    c[25].visible = true;

    this.grid.refreshColumns();
  }

  actionBegin(event) {
    if (event.requestType == "save") {
      let companyName = sessionStorage.getItem(COMPANY_NAME);
      let content = {
        "transationId": event.data.TransationId,
        "refrenceId": event.data.refrenceId,
        "companyName": companyName,
        "parentRefrenceId": event.data.parentReferenceId
      }
      this.masterTrackerCreatorService.updateParentRefrenceId(content).subscribe(response => {
        if (response == true) {
          for (let i = 0; i < this.data.length; i++) {
            if (this.data[i].refrenceId === event.data.refrenceId) {
              this.data[i].parentReferenceId = event.data.parentReferenceId;
              break;
            }
          }
        }
      })
    }
  }

  toolbarClick(args: ClickEventArgs): void {
    if (args.item.id.endsWith('clear')) {
      this.grid.searchSettings.key = '';
      (this.grid.element.querySelector(".e-input-group.e-search .e-input") as any).value = "";
    }
    if (args.item.id.endsWith('Update')) {
      alert('dsfdgdfg')
      this.grid.showSpinner();
      this.updateMasterTracker();
    }
    if (args.item.id.endsWith('masterTracker')) {
      this.selectOptions = { type: 'Multiple' };
      this.groupOptions = { columns: [] };
      this.getMasterTrackerData123();
      this.viewDataColumn();
    }
    if (args.item.id.endsWith('view')) {
      //  this.duplicateReferenceId = this.selectedBatch.blId
      this.comparePDFTemplate.show();
      this.comparePdfJSViewer()
      this.comparePdfJSViewer1()
      // this.blankReferenceId()

    }


    //Master matchup addendum.
    if (args.item.id.endsWith('Update Matchup')) {

      this.matchupTemplateDialog.show();
      this.groupOptions = { columns: [] };

      // alert("Yesss");
      // this.data = [];
      // // If statement logig to hide columns in the grid.
      // if (this.grid != null && this.grid != undefined) {
      //   let c: Column[] = this.grid.getColumns();
      //   c[0].visible = false;
      //   c[1].visible = true;
      //   c[2].visible = true;
      //   c[3].visible = true;
      //   c[4].visible = false;
      //   c[5].visible = false;
      //   c[6].visible = false;
      //   c[7].visible = false;
      //   c[8].visible = false;
      //   c[9].visible = false;
      //   c[10].visible = false;
      //   c[11].visible = false;
      //   c[12].visible = false;
      //   c[13].visible = false;
      //   c[14].visible = false;
      //   c[15].visible = false;
      //   c[16].visible = true;
      //   c[17].visible = true;
      //   c[18].visible = true;
      //   c[19].visible = true;
      //   c[20].visible = true;
      //   c[21].visible = true;
      //   c[22].visible = false;
      //   c[23].visible = false;
      //   c[24].visible = false;
      //   c[25].visible = false;
      //   this.grid.refreshColumns();
      // }

      // this.masterTrackerCreatorService.getDataBasedStatus().subscribe(dataList => {
      //   this.masterMatchUpAddendum = dataList;
      //   for (let i = 0; i < this.masterMatchUpAddendum.length; i++) {
      //     this.masterMatchUpAddendum[i]["blId"] = this.masterMatchUpAddendum[i].refrenceId;
      //   }
      //   this.data = this.masterMatchUpAddendum;

      // })
    }


    if (args.item.id.endsWith('Create Segregation Batches')) {
      this.ejDialogForCreateBatch.show()
    }
    if (args.item.id.endsWith('Create OCR Batches')) {
     
      this.ejDialogForCreateBatches.show()
    }

    if (args.item.id.endsWith('Create Batches For Execution')) {
      this.ejDialogForCreateBatchExecution.show()
    }

  }
  // end master matchup.


  updateMasterTracker() {
    let obj = [];
    this.toolService.PutDataInMasterTracker().subscribe(
      (DataToSend : any[])=> {
        console.log(JSON.stringify(DataToSend)+"this    is aaaaara")
        for (var k = 0; k < DataToSend.length; k++){
              console.log(DataToSend[k].path+"uuuuuuuuuuuu")
        }

        obj  = DataToSend ;
        for (let m = 0; m < obj.length; m++) {
          let Obj1: any;
          Obj1 = { "fileName": obj[m].file, "filePath": obj[m].path, "fileSize": obj[m].size, "date": obj[m].date };
          this.files.push(Obj1);
        }
        console.log(JSON.stringify(this.files)+"WE WILLL SAVE THIS IN DATABASE ")
        this.masterTrackerCreatorService.createMasterTracker(this.files).subscribe(
          response => {
            console.log("GOGING TO DATABASE ****************")
            $("#filename").val("");
            // this.saveFile(response.body, "MasterFileTracker.xlsx");
            this.getMasterTrackerData123(); //commented for testing

            this.isLoading = false;

          }
        )
      })
     
    console.log("Line 399 inn ***********updateMasterTracker****************");
  /*  let arr: {};
   
    this.files = [];
    this.batchocrService.getListOfFolderDocumentMasterTracker().subscribe(
      (folderFiles: any[]) => {
        this.folderdata = folderFiles;
        this.masterTrackerCreatorService.masterTrackerFileView(this.company_id).subscribe(
          dbdocs => {
            if (dbdocs != null && this.folderdata != null) {
              var aObject: any;
              var newDBFiles = [];
              for (let j = 0; j < dbdocs['masterTracker'].length; j++) {
                aObject = { "path": dbdocs['masterTracker'][j].filePath, "file": dbdocs['masterTracker'][j].fileName, "convertedStatus": dbdocs['masterTracker'][j].convertedStatus };
                newDBFiles.push(aObject);
              }
              for (var i = this.folderdata.length - 1; i >= 0; i--) {
                for (var k = 0; k < newDBFiles.length; k++) {
                 
                  if (this.folderdata[i] && (this.folderdata[i].path === newDBFiles[k].path) || newDBFiles[k].convertedStatus == "Done") {
                  console.log(this.folderdata[i].path +"we are splting this ******************************")
                    this.folderdata.splice(i, 1);
                  }
                }
              }
         
              obj = this.folderdata;
            }
            else {
         
              obj = this.folderdata;
            }
            for (let m = 0; m < obj.length; m++) {
              let Obj1: any;
              Obj1 = { "fileName": obj[m].file, "filePath": obj[m].path, "fileSize": obj[m].size, "date": obj[m].date };
              this.files.push(Obj1);
            }
            console.log(JSON.stringify(this.files)+"WE WILLL SAVE THIS IN DATABASE ")
            this.masterTrackerCreatorService.createMasterTracker(this.files).subscribe(
              response => {
                console.log("GOGING TO DATABASE ****************")
                $("#filename").val("");
                // this.saveFile(response.body, "MasterFileTracker.xlsx");
                this.getMasterTrackerData123(); //commented for testing

                this.isLoading = false;

              }
            )

          }
        )
      }
    ) */
    console.log("Line 447 inn ***********out od update MasterTracker****************");

  }
  rowSelecting(args) {
    //   args.cancel = args.rowIndexes && args.rowIndexes.length > 2;

  }


  rowSelectedFindDuplicate(args) {

    let t: any = args.data as any;
    // this.ReferceId.push(t.blId)
    if (this.ReferceId.length < 2) {
      this.ReferceId.push(t.blId)
      this.viewDocName.push(t.filePath)

    }
    else {
      this.ReferceId = []
      this.viewDocName = []
      this.ReferceId.push(t.blId)
      this.viewDocName.push(t.filePath)
    }


  }

  rowDeSelectedFindDuplicate(args: RowSelectEventArgs) {
    let t: any = args.data as any;
    t.blId
    for (let index = 0; index < this.ReferceId.length; index++) {
      const element = this.ReferceId[index];
      if (t.blId == element) {
        this.ReferceId.splice(index, 1)

      }
    }
    for (let index = 0; index < this.viewDocName.length; index++) {
      const element = this.viewDocName[index];
      if (t.filePath == element) {
        this.viewDocName.splice(index, 1)

      }
    }
  }
  updateData() {
    let arr: {};
    let obj = [];
    this.masterTrackerCreatorService.masterTrackerFileView(this.company_id).subscribe(
      response => {
        this.data = response['masterTracker'];
        var a = [];
        var b;
        for (let n = 0; n < this.data.length; n++) {
          b = this.data[n].filePath;
           b = b.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID) + "/", "");
         // b = b.replace("C:\\AE_HOME\\Ftp_Location\\1\\", "");
          obj[n] = {
            "blId": this.data[n].blId, "filePath": b, "fileName": this.data[n].fileName, "fileExtension": this.data[n].fileExtension, "fileType": this.data[n].fileType,
            "fileSizeInKb": this.data[n].fileSizeInKb, "OCR Status": "P",
          }
          a.push(obj[n]);
        }
        this.data = a;
      })
  }
  findDuplicate() {
    this.selectOptions = { type: 'Multiple' };
    this.data = [];
    this.isShow = true;
    this.masterdata1 = []
    this.ReferceId = []
    this.viewDocName = []
    this.fileNameList = []
    let obj = [];
    this.masterTrackerCreatorService.getDuplicatesByFileName().subscribe(
      (response => {

        if (this.grid != null && this.grid != undefined) {
          let c: Column[] = this.grid.getColumns();
          c[0].visible = false;
          c[1].visible = true;
          c[2].visible = false;
          c[3].visible = true;
          c[4].visible = true;
          c[5].visible = true;
          c[6].visible = false;
          c[7].visible = false;
          c[8].visible = true;
          c[9].visible = true;
          c[10].visible = false;
          c[11].visible = false;
          c[12].visible = false;
          c[13].visible = false;
          c[14].visible = false;
          c[15].visible = true;
          c[16].visible = false;
          c[17].visible = false;
          c[18].visible = false;
          c[19].visible = false;
          c[20].visible = false;
          c[21].visible = false;
          c[22].visible = false;
          c[23].visible = false;
          c[24].visible = false;
          c[25].visible = false;
          this.grid.refreshColumns();
        }

        let duplicates: any
        duplicates = response;

        for (let index = 0; index < duplicates.length; index++) {
          let filename = duplicates[index].FileName;

          let element = duplicates[index].FileList;

          for (let i = 0; i < element.length; i++) {
            let file = element[i];
            let fileExtension = element[i].FileName.split('.').slice(0, -1).join('.');
            this.fileNameList.push(fileExtension)

            if (file) {
              this.masterdata1.push(file);
            }
          }
        }

        let duplicatesObj = [];
        let path;
        for (let n = 0; n < this.masterdata1.length; n++) {
          path = this.masterdata1[n].filePath;
        path = path.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID), "");
       //  path = path.replace("C:\\AE_HOME\\Ftp_Location\\1", "");
          obj[n] = {
            "blId": this.masterdata1[n].blId, "filePath": path, "fileName": this.masterdata1[n].FileName, "fileNameWithout": this.fileNameList[n], "fileExtension": this.masterdata1[n].fileExtension, "fileType": this.masterdata1[n].fileType,
            "fileSizeInKb": this.masterdata1[n].fileSizeInKb, "isDuplicate": this.masterdata1[n].isDuplicate
          }
          duplicatesObj.push(obj[n]);
        }
        this.data = duplicatesObj;
      }))

  }
  enableEditing(event, selectedData, template: DialogComponent, type: any) {

    this.markDuplicateReferenceId = selectedData.blId
    this.duplicateData = []

    if (type === 'duplicateByName') {

      for (let index = 0; index < this.data.length; index++) {
        if (selectedData.blId != this.data[index].blId && selectedData.fileNameWithout == this.data[index].fileNameWithout && this.data[index].isDuplicate == "No") {
          let file = this.data[index];
          this.duplicateData.push(file)
        }
      }
      if (this.duplicateData.length != 0) {
        this.FindByNameTemplate.show();
      }

      else {
        DialogUtility.alert("You cannot mark this File as Duplicate")

      }
    }
    else if (type === 'duplicateByContent') {
      for (let index = 0; index < this.data.length; index++) {

        if (selectedData.blId != this.data[index].blId && this.data[index].isDuplicate == "No" && selectedData.fileNameWithout == this.data[index].fileNameWithout) {
          let file = this.data[index];
          this.duplicateData.push(file)
        }
      }
      if (this.duplicateData.length != 0) {
        template.show();
      }
      else {
        DialogUtility.alert("You cannot mark this File as Duplicate")

      }
    }
  }

  rowSelectedForDuplicate(args: RowSelectEventArgs) {
    let t: any = args.data as any;
    this.selectedBatch = t;
    this.duplicateReferenceId = this.selectedBatch.blId
  }
  onDuplicateClick(template: DialogComponent) {
       template.hide();

    this.FindByNameTemplate.hide();
    this.markDuplicate(this.duplicateReferenceId)
  }
  onDuplicateClickContent(template: DialogComponent) {
   // template.hide();
    let content = {
      "duplicateRefId": this.markDuplicateReferenceId,
      "duplicateOfWhichRefId": this.duplicateReferenceId,
      "userName": sessionStorage.getItem("authenticateUser")

    }
    this.masterTrackerCreatorService.markDuplicate(content).subscribe(
      (response => {
        if (response == "Success") {
          // this.findDuplicate();
          this.findDuplicateByContent()
        }
      }))
  }

  markDuplicate(duplicateReferenceId) {
    let content = {
      "duplicateRefId": this.markDuplicateReferenceId,
      "duplicateOfWhichRefId": duplicateReferenceId,
      "userName": sessionStorage.getItem("authenticateUser")

    }
    this.masterTrackerCreatorService.markDuplicate(content).subscribe(
      (response => {
        if (response == "Success") {
          this.findDuplicate();
        }
      }))
  }

  onCancelClick(template: DialogComponent) {
    this.FindByNameTemplate.hide();
  }

  viewPDF(event, selectedData, PDFtemplate: DialogComponent) {
    let viewDuplicateReferenceId = selectedData.blId
    this.viewDocumentName = selectedData.filePath
    PDFtemplate.show();
    this.masterTrackerCreatorService.showDocument(viewDuplicateReferenceId).subscribe(
      response => {

        this.saveFile(response.body, viewDuplicateReferenceId);

      })
  }

  saveFile(data: any, filename: number) {

    const blob = new Blob([data], { type: 'application/octet-stream' });
    this.currentPdf = URL.createObjectURL(blob);
  }

  undoDuplicate(event, selectedData) {
    let undoDuplicateReferenceId = selectedData.blId
    this.masterTrackerCreatorService.undoDuplicate(undoDuplicateReferenceId).subscribe(
      response => {
        if (response == "Success") {
          this.findDuplicate();

        }

      })

  }

  comparePdfJSViewer1() {

    this.name = this.viewDocName[0]
    this.masterTrackerCreatorService.showDocumentForJSViewer(this.ReferceId[0]).subscribe(
      response => {
        // this.myPdfViewer1.pdfSrc = response;
        // this.myPdfViewer1.refresh();

      })

  }
  comparePdfJSViewer() {
    this.name1 = this.viewDocName[1]
    this.masterTrackerCreatorService.showDocumentForJSViewer(this.ReferceId[1]).subscribe(
      response => {
        // this.myPdfViewer2.pdfSrc = response;
        // this.myPdfViewer2.refresh();

      })

  }

  public onSelect(args: any): void {
    if (args.item.text === 'Duplicate By Name') {
      this.groupOptions = { columns: ['fileNameWithout'] };
      this.findDuplicate();
    }
    if (args.item.text === 'Duplicate By Content') {
      alert('duplicate');
      this.findDuplicateByContent()
      this.groupOptions = { columns: ['fileNameWithout'] };
      this.updateMasterTracker();
    }
  }

  findDuplicateByContent() {
    alert('inside content api');
    this.selectOptions = { type: 'Multiple' };
    let obj = [];
    this.masterdataContent = []
    this.GroupList = []
    this.masterTrackerCreatorService.getDuplicatesByContent().subscribe(
      (response => {
        if (this.grid != null && this.grid != undefined) {
          let c: Column[] = this.grid.getColumns();

          c[0].visible = false;
          c[1].visible = true;
          c[2].visible = false;
          c[3].visible = true;
          c[4].visible = true;
          c[5].visible = true;
          c[6].visible = false;
          c[7].visible = false;
          c[8].visible = true;
          c[9].visible = true;
          c[10].visible = false;
          c[11].visible = false;
          c[12].visible = false;
          c[13].visible = false;
          c[14].visible = false;
          c[15].visible = false;
          c[16].visible = false;
          c[17].visible = false;
          c[18].visible = false;
          c[19].visible = false;
          c[20].visible = false;
          c[21].visible = false;
          c[22].visible = false;
          c[23].visible = true;
          c[24].visible = false;
          c[25].visible = false;
          this.grid.refreshColumns();
        }

        let duplicatesContent: any
        duplicatesContent = response;

        for (let index = 0; index < duplicatesContent.length; index++) {
          let Group = duplicatesContent[index].Group;

          let element = duplicatesContent[index].FileList;

          for (let i = 0; i < element.length; i++) {
            let fileContent = element[i];
            this.GroupList.push(Group)

            if (fileContent) {
              this.masterdataContent.push(fileContent);
            }
          }

        }

        let duplicatesObjContent = [];
        let path;
        for (let n = 0; n < this.masterdataContent.length; n++) {
          path = this.masterdataContent[n].filePath;
         path = path.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID), "");
      //  path = path.replace("C:\\AE_HOME\\Ftp_Location\\1", "");
          obj[n] = {
            "blId": this.masterdataContent[n].blId, "filePath": path, "fileName": this.masterdataContent[n].FileName, "fileExtension": this.masterdataContent[n].fileExtension, "fileType": this.masterdataContent[n].fileType,
            "fileSizeInKb": this.masterdataContent[n].fileSizeInKb, "fileNameWithout": this.GroupList[n], "isDuplicate": this.masterdataContent[n].isDuplicate
          }
          duplicatesObjContent.push(obj[n]);
        }
        this.data = duplicatesObjContent;
        console.log(("duplicate by content" + this.data));
       
      }))
  }

  undoDuplicateContent(event, selectedData) {
    let undoDuplicateReferenceId = selectedData.blId
    this.masterTrackerCreatorService.undoDuplicate(undoDuplicateReferenceId).subscribe(
      response => {
        if (response == "Success") {
          this.findDuplicateByContent();
        }
      })

  }
  contextMenuClick(args: MenuEventArgs): void {
    let convert: any[] = this.grid.getSelectedRecords()

    if (args.item.id === 'ConvertToPdf') {
      this.grid.showSpinner();
      this.ExtractionserviceService.convertToPDF(convert).subscribe(
        (response1 => {
          this.grid.hideSpinner();
          DialogUtility.alert("File is Converted successfully")
        })
      )
    }
    if (args.item.id === 'View') {
      // this.grid.showSpinner();
      var filepath = convert[0].filePath;
      this.ExtractionserviceService.getDocInMaster(filepath).subscribe(
        (response1 => {
          // this.myPdfViewer1.pdfSrc = response1;
          //    this.saveFile1(response1.body,filepath );
          // this.grid.hideSpinner();
          // DialogUtility.alert("Files are Converted successfully")
        })
      )
    }

    if (args.item.id === 'Extract') {
      let allZip
      let s: any[] = this.grid.getSelectedRecords()
      for (let i = 0; i < s.length; i++) {
        if (s[i].fileExtension === 'zip') {
         
          allZip = true;
        }
        else if (s[i].fileExtension === '7z') {
          allZip = true;
        }
        else if (s[i].fileExtension === 'tar') {
          allZip = true;
        }
        else {
          allZip = false;
          break
        }
      }
      if (allZip) {

        this.ExtractionserviceService.ExtractMultipleFiles(s).subscribe(
          (response => {
         
            DialogUtility.alert("Files are extracted successfully")
         
            setTimeout(() => {
              this.updateMasterTracker();
              this.grid.refresh();
            }, 1000);
            setTimeout(() => {
              this.ExtractionserviceService.ExtractMultipleFilesNameSourceFolder(s).subscribe(
                (response => {

                }))
              this.grid.refresh();
            }, 2000);

          }))


      } else {
        DialogUtility.alert("Please select only Compressed files")
        this.grid.refresh();
      }
    }
    if (args.item.id === 'View Files') {
      let s: any[] = this.grid.getSelectedRecords()
      if (s.length < 2) {
        if (s[0].fileExtension === 'zip') {
          let blId: number = s[0].blId;
          this.ExtractionserviceService.getListOfFilesInZip(blId).subscribe(
            (response1 => {
              this.dataInZip = response1
            })
          )
          if (this.dataInZip != undefined) {
            this.ejDialog.show();
          }
        }
      } else {
        DialogUtility.alert("Select only 1 row")
      }
    }
    if (args.item.id === 'markAsRelevant') {
      let s: any[] = this.grid.getSelectedRecords()
      this.ExtractionserviceService.MarkASRelevant(s).subscribe(
        (response => {
        }))
    }


  }

  saveFile1(data: any, filename?: string) {
    const blob = new Blob([data], { type: 'application/octet-stream' });
    this.currentPdf = URL.createObjectURL(blob);
  }
  contextMenuOpen(args) {
    var contextmenu = this.grid.contextMenuModule.contextMenu;
    if (args.rowInfo.rowData.fileType != 'zip' && args.rowInfo.rowData.fileType != '7z' && args.rowInfo.rowData.fileType != 'tar' && args.rowInfo.rowData.fileType != 'rar') {
      contextmenu.enableItems(['Extract'], false);
      contextmenu.enableItems(['View Files'], false);
    }
    if (args.rowInfo.rowData.ConvertedStatus == "Done" ||  args.rowInfo.rowData.fileExtension == "pdf" || args.rowInfo.rowData.fileExtension == "PDF" || args.rowInfo.rowData.fileExtension == "zip" || args.rowInfo.rowData.fileExtension == "rar") {
      contextmenu.enableItems(['Convert To Pdf'], false);                               //disable the context menu item
    } else {
      contextmenu.enableItems(['Convert To Pdf'], true);
    }
    if (args.rowInfo.rowData.extractionStatus === 'Extraction Completed') {
      contextmenu.enableItems(['Extract'], false);
      contextmenu.enableItems(['Convert To Pdf'], false);
    }
    if (args.rowInfo.rowData.fileType == 'zip' || args.rowInfo.rowData.fileType == '7z' || args.rowInfo.rowData.fileType == 'tar' || args.rowInfo.rowData.fileType == 'rar') {
      contextmenu.enableItems(['Convert To Pdf'], false);

    }
    // if (args.rowInfo.rowData.fileType != 'zip' && args.rowInfo.rowData.fileType != '7z' && args.rowInfo.rowData.fileType != 'tar') {
    //   contextmenu.enableItems(['View'], false);                               //disable the context menu item
    // } else {
    //   contextmenu.enableItems(['View'], true);
    // }
  }

  onChangeOfDropDown(args) {

    // Update Matchup


    if (args.value === 'Master Tracker') {
      this.selectOptions = { type: 'Multiple' };
      this.groupOptions = { columns: [] };
      this.contextMenuItems = [{ text: 'Extract', target: '.e-content', id: 'Extract' },
      { text: 'View Files', target: '.e-content', id: 'View Files' },
      { text: 'Information', target: '.e-content', id: 'Information' },
      { text: 'Convert To Pdf', target: '.e-content', id: 'ConvertToPdf' },

      ];
      this.getMasterTrackerData123(); //commented for testing
      this.viewDataColumn();
      this.SettingToolBar()
      this.valueDropDown = 'Master Tracker'
    } else if (args.value === 'OCR') {
      //    this.grid.showSpinner();
      this.grid.refreshColumns();
      this.grid.refresh();
      this.contextMenuItems = [ { text: 'Convert To Pdf', target: '.e-content', id: 'ConvertToPdf' }];
      this.valueDropDown = 'OCR'
      this.toolbar = [
        //  { template: this.toolbarTemplates },
        { template: this.toolbarTemplate11 },

        'Create OCR Batches'

      ];
      // this.data = [];
      let arr: {};
      let obj = [];
      this.masterTrackerCreatorService.getOcrFiles(this.company_id).subscribe(
        (folderFiles: any[]) => {
          this.folderdata = folderFiles;
          this.batchocrService.getListOfDBDocumentOcr().subscribe(
            dbdocs => {
              if (dbdocs != null && this.folderdata != null) {
                var aObject: any;
                var newDBFiles = [];
                for (let j = 0; j < dbdocs['BatchingOCR'].length; j++) {
                  for (let k = 0; k < dbdocs['BatchingOCR'][j].batchingOCRFilename.length; k++) {
                    aObject = { "path": dbdocs['BatchingOCR'][j].batchingOCRFilename[k].filePath, "file": dbdocs['BatchingOCR'][j].batchingOCRFilename[k].fileName };
                    newDBFiles.push(aObject);
                  }
                }
                for (var i = this.folderdata['masterTracker'].length - 1; i >= 0; i--) {
                  let data = this.folderdata['masterTracker'][i];
                  for (var j = 0; j < newDBFiles.length; j++) {
                    if (this.folderdata['masterTracker'] && (data.filePath === newDBFiles[j].path)) {
                      this.folderdata['masterTracker'].splice(i, 1);
                    }
                  }
                }
                obj = this.folderdata;
              }
              else {
                obj = this.folderdata;
              }
              var a = [];
              var b;
              if (obj != null) {
                for (let i = 0; i < obj['masterTracker'].length; i++) {
                  b = obj['masterTracker'][i].filePath;
                 b = b.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID) + "/", "");
                 // b = b.replace("C:\\AE_HOME\\Ftp_Location\\1\\", "");
                  obj[i] = { "blId": obj['masterTracker'][i].blId, "filePath": b, "fileName": obj['masterTracker'][i].fileName }
                  a.push(obj[i]);
                }
                this.data = a;
                let c: Column[] = this.grid.getColumns();
                c[0].visible = false;
                c[1].visible = true;
                c[2].visible = false;
                c[3].visible = true;
                c[4].visible = true;
                c[5].visible = false;
                c[6].visible = false;
                c[7].visible = false;
                c[8].visible = false;
                c[9].visible = false;
                c[10].visible = false;
                c[11].visible = false;
                c[12].visible = false;
                c[13].visible = false;
                c[14].visible = false;
                c[15].visible = false;
                c[16].visible = false;
                c[17].visible = false;
                c[18].visible = false;
                c[19].visible = false;
                c[20].visible = false;
                c[21].visible = false;
                c[22].visible = false;
                c[23].visible = false;
                c[24].visible = false;
                c[25].visible = false;
                this.grid.refreshColumns();
              }
              else {
                this.OCRBatchQuntity = true;
              }
            })
        }
      )
      this.valueDropDown = 'OCR'
      this.grid.refreshColumns();
      this.grid.refresh();
    } else if (args.value === 'Segregation') {


      this.valueDropDown = 'Segregation'
      this.toolbar = [
        { template: this.toolbarTemplate11 },
        'Create Segregation Batches'
      ];
      this.data = [];
      this.contextMenuItems = [];
      this.SegregationM()

      this.valueDropDown = 'Segregation'


    } else if (args.value === 'Execution') {
      //    this.grid.showSpinner();


      this.data = [];
      this.contextMenuItems = [];


      this.ExecutionM()

      this.valueDropDown = 'Execution'
      this.toolbar = [
        { template: this.toolbarTemplate11 },
        'Create Batches For Execution'
      ];
      this.valueDropDown = 'Execution'

    }
    else if (args.value === 'Irrelevant Files') {
      this.grid.refreshColumns();
      this.grid.refresh();

      this.data = [];

      this.contextMenuItems = [
        { text: 'Mark As Relevant', target: '.e-content', id: 'markAsRelevant' }
      ];



      this.valueDropDown = 'Irrelevant Files'
      this.toolbar = [
        { template: this.toolbarTemplate11 }

      ];
      this.groupOptions = { columns: [] };
      this.data = [];
      this.toolService.getIrrelevantData().subscribe(
        (response => {
          this.data = response
          let c: Column[] = this.grid.getColumns();
          c[0].visible = false;
          c[1].visible = true;
          c[2].visible = false;
          c[3].visible = true;
          c[4].visible = true;
          c[5].visible = true;
          c[6].visible = false;
          c[7].visible = false;
          c[8].visible = true;
          c[9].visible = true;
          c[10].visible = false;
          c[11].visible = false;
          c[12].visible = false;
          c[13].visible = false;
          c[14].visible = false;
          c[15].visible = false;
          c[16].visible = false;
          c[17].visible = false;
          c[18].visible = false;
          c[19].visible = false;
          c[20].visible = false;
          c[21].visible = false;
          c[22].visible = false;
          c[23].visible = false;
          c[24].visible = false;
          c[25].visible = false;
          this.grid.refreshColumns();
        })
      )

    } else if (args.value === 'Parent-Child Matchup') {

      this.valueDropDown = 'Parent-Child Matchup';
      this.data = [];
      // If statement is used to add or hide columns in the grid.
      if (this.grid != null && this.grid != undefined) {
        let c: Column[] = this.grid.getColumns();
        c[0].visible = false;
        c[1].visible = true;
        c[2].visible = true;
        c[3].visible = true;
        c[4].visible = false;
        c[5].visible = false;
        c[6].visible = false;
        c[7].visible = false;
        c[8].visible = false;
        c[9].visible = false;
        c[10].visible = false;
        c[11].visible = false;
        c[12].visible = false;
        c[13].visible = false;
        c[14].visible = false;
        c[15].visible = false;
        c[16].visible = true;
        c[17].visible = true;
        c[18].visible = true;
        c[19].visible = true;
        c[20].visible = true;
        c[21].visible = true;
        c[22].visible = false;
        c[23].visible = false;
        c[24].visible = false;
        c[25].visible = false;
        this.grid.refreshColumns();
        this.grid.refresh();
      }

      this.masterTrackerCreatorService.getDataBasedStatus().subscribe(dataList => {
        this.masterMatchUpAddendum = dataList;
        for (let i = 0; i < this.masterMatchUpAddendum.length; i++) {
          this.masterMatchUpAddendum[i]["blId"] = this.masterMatchUpAddendum[i].refrenceId;
        }
        this.data = this.masterMatchUpAddendum;

      })
    }


  }
  validatenoOfBatchesocr(a: any) {
    var docCounta = $('#noOfBatchesforOCR').val();
    var numberValue = Number(docCounta);
    if (numberValue <= 0) {
      this.showZeroMessage = true;
    } else {
      this.showZeroMessage = false;
    }
    if (numberValue > this.data.length) {
      this.showtotalFilesMessage = true;
    } else {
      this.showtotalFilesMessage = false;
    }
  }


  validatenoOffiles(noOffiles) {
    var docCounta = $('#noOffiles').val();
    var numberValue = Number(docCounta);
    if (numberValue <= 0) {

      this.showZeroMessage1 = true;

    }
    else {
      this.showZeroMessage1 = false;
    }
    if (numberValue > this.data.length) {
     this.showtotalFilesMessage1 = true;
    }
    else {
      this.showtotalFilesMessage1 = false;
     }

  }

  validatenoOffilesOcr(noOffiles) {
    var docCounta = $('#noOffilesforOCR').val();
     var numberValue = Number(docCounta);
    if (numberValue <= 0) {

      this.showZeroMessage1 = true;

    }
    else {
      this.showZeroMessage1 = false;
    }
    if (numberValue > this.data.length) {
     this.showtotalFilesMessage1 = true;
    }
    else {
      this.showtotalFilesMessage1 = false;
      }

  }

  BatchTypeNO(selectCompanyForm, noOfBatches) {
    var docCounta = $('#noOfBatches').val();
     var noOffiles = $('#noOffiles').val();
     var numberValue = Number(docCounta);
    var noOffilesNumber = Number(noOffiles);

    if (!isNaN(numberValue)) {


      if (numberValue > 0 && numberValue <= this.data.length) {


        if (numberValue > 0) {

          if (numberValue != undefined && numberValue != NaN) {

            this.toolService.addEqualSegregationBatchesAccnoOfBatches(numberValue).subscribe(
              response => {
                //  this.router.navigate(['dashboard/SegregationschedulingComponent']);
                DialogUtility.alert("Batches  created successfully")
                this.data = [];
                this.ejDialog.hide();
                this.ejDialogForCreateBatch.hide()

              }

            )

          }
        }
      } else {


        if (numberValue === 0) {
        }

      }


    }


    if (!isNaN(noOffilesNumber)) {


      if (noOffilesNumber > 0 && noOffilesNumber <= this.data.length) {


        if (noOffilesNumber != undefined && noOffilesNumber != NaN) {

          this.toolService.addEqualSegregationBatchesAccnoOffiles(noOffilesNumber).subscribe(
            response => {
              //      this.router.navigate(['dashboard/SegregationschedulingComponent']);
              DialogUtility.alert("Batches  created successfully")
              this.data = [];
              this.ejDialog.hide();
              this.ejDialogForCreateBatch.hide()
            }

          )


        }
      }
    }


  }
  createBatchesforOCR(selectForm, noOfBatchesforOCR) {
    var docCounta = $('#noOfBatchesforOCR').val();
    var noOffiles = $('#noOffilesforOCR').val();
   
    var numberValue = Number(docCounta);
    var noOffilesNumber = Number(noOffiles);
   
    if (!isNaN(numberValue)) {
      if (numberValue > 0 && numberValue <= this.data.length) {
        if (numberValue > 0) {
          if (numberValue != undefined && numberValue != NaN) {
            this.batchocrService.createEqualOcrBatch(numberValue).subscribe(
              response => {
                 // this.router.navigate(['dashboard/allBatches']);
                DialogUtility.alert("Batch created successfully")
         
                this.data = [];
                this.ejDialogForCreateBatches.hide()
         


              }
            )
          }
        }
      } else {
        if (numberValue === 0) {
        }
      }
    }
    if (!isNaN(noOffilesNumber)) {
      if (noOffilesNumber > 0 && noOffilesNumber <= this.data.length) {
        if (noOffilesNumber != undefined && noOffilesNumber != NaN) {

          this.batchocrService.createEqualOcrBatches(noOffilesNumber).subscribe(
            response => {
             
              DialogUtility.alert("Batch created successfully")
              this.ejDialogForCreateBatches.hide();
              // this.router.navigate(['dashboard/ocrscheduling']);
              this.data = [];
              this.ejDialogForCreateBatches.hide()
            }
          )
          // this.toolService.addEqualSegregationBatchesAccnoOffiles(noOffilesNumber).subscribe(
          //   response => {
          //     this.router.navigate(['dashboard/SegregationschedulingComponent']);

          //     this.data = [];
          //     this.ejDialog.hide();
          //   }

          // )


        }
      }
    }


  }
  SettingToolBar() {
    this.toolbar = [
      { template: this.toolbarTemplate11 },
      { template: this.toolbarTemplates },
      // {
      //   text: 'View', tooltipText: 'view',
      //   id: 'view', align: 'Right'
      // },
      'ColumnChooser', 'Search',
      {
        text: 'Clear', tooltipText: 'Clear Search',
        prefixIcon: 'e-cancel', id: 'clear', align: 'Right'
      },

      {
        text: 'Update', tooltipText: 'Update',
        prefixIcon: 'e-save', id: 'Update', align: 'left'
      },
   /*   {
        text: 'Master Matchup Addendum', tooltipText: 'Master Matchup Addendum',
        id: 'masterMatchupAddendum', align: 'Left'
      },*/

      { template: this.toolbarTemplate }

    ];

  }

  validatenoOfBatchesExecution(a: any) {
    var docCounta = $('#noOfBatches').val();
    var numberValue = Number(docCounta);
    if (numberValue <= 0) {
      this.showZeroMessageExecution = true;
    } else {
      this.showZeroMessageExecution = false;
    }
    if (numberValue > this.data.length) {
      this.showtotalFilesMessageExecution = true;
    } else {
      this.showtotalFilesMessageExecution = false;
    }
  }


  validatenoOffilesExecution(noOffiles) {
    var docCounta = $('#noOffiles').val();
    var numberValue = Number(docCounta);
     if (numberValue <= 0) {

      this.showZeroMessage1Execution = true;

    }
    else {
      this.showZeroMessage1Execution = false;
    }
    if (numberValue > this.data.length) {
       this.showtotalFilesMessage1Execution = true;
    }
    else {
      this.showtotalFilesMessage1Execution = false;
     
    }

  }



  BatchTypeNOExecution(selectCompanyForm, noOfBatches) {
    var docCounta = $('#noOfBatchesExecution').val();

    console.log(docCounta + "this is doccount ")
    var noOffiles = $('#noOffilesExecution').val();
    console.log(noOffiles + "this is noOffiles ")
    var numberValue = Number(docCounta);
    var noOffilesNumber = Number(noOffiles);

    if (!isNaN(numberValue)) {


      if (numberValue > 0 && numberValue <= this.data.length) {


        if (numberValue > 0) {

          if (numberValue != undefined && numberValue != NaN) {

            this.toolService.addEqualExecutionBatchesAccnoOfBatches(numberValue).subscribe(
              response => {
                //  this.router.navigate(['dashboard/SegregationschedulingComponent']);
                DialogUtility.alert("Batches  created successfully")
                this.data = [];
                this.ejDialog.hide();
                //  this.ejDialogForCreateBatch.hide()
                this.ejDialogForCreateBatchExecution.hide()

              }

            )

          }
        }
      } else {


        if (numberValue === 0) {
        }

      }


    }


    if (!isNaN(noOffilesNumber)) {


      if (noOffilesNumber > 0 && noOffilesNumber <= this.data.length) {


        if (noOffilesNumber != undefined && noOffilesNumber != NaN) {

          this.toolService.addEqualExecutionBatchesAccnoOffiles(noOffilesNumber).subscribe(
            response => {
              //      this.router.navigate(['dashboard/SegregationschedulingComponent']);
              DialogUtility.alert("Batches  created successfully")
              this.data = [];
              this.ejDialog.hide();
              //  this.ejDialogForCreateBatch.hide()
              this.ejDialogForCreateBatchExecution.hide()
            }

          )


        }
      }
    }


  }


  SegregationM() {
    var a11 = [];
    this.data = []
    let obj13 = [];
    var Seg1: any[] = [];
    this.toolService.ViewFilesForSegregationBatching().subscribe(
      (folderFiles: any[]) => {
        Seg1 = folderFiles
        for (let i: number = 0; i < Seg1.length; i++) {
          let pathToShow = Seg1[i]['filePath'];
         pathToShow = pathToShow.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID) + "/", "");
       //  pathToShow = pathToShow.replace("C:\\AE_HOME\\Ftp_Location\\1\\", "");

          obj13[i] = { "filePath": pathToShow, "fileName": Seg1[i]['fileName'], 'blId': Seg1[i]['refrenceId'] }

          a11.push(obj13[i])
        }
        this.data = a11

        let c: Column[] = this.grid.getColumns();
        c[0].visible = true;
        c[1].visible = true;
        c[2].visible = false;
        c[3].visible = true;
        c[4].visible = true;
        c[5].visible = true;
        c[6].visible = false;
        c[7].visible = false;
        c[8].visible = false;
        c[9].visible = false;
        c[10].visible = true;
        c[11].visible = true;
        c[12].visible = true;
        c[13].visible = false;
        c[14].visible = false;
        c[15].visible = false;
        c[16].visible = false;
        c[17].visible = false;
        c[18].visible = false;
        c[19].visible = false;
        c[20].visible = false;
        c[21].visible = false;
        c[22].visible = false;
        c[23].visible = false;
        c[24].visible = false;
        c[25].visible = false;
        this.grid.refreshColumns();


      }
    )




  }

  ExecutionM() {
    var a11 = [];
    this.data = []
    let obj13 = [];
    var Seg1: any[] = [];
    this.toolService.ViewFilesForExecutionBatching().subscribe(
      (folderFiles: any[]) => {
        Seg1 = folderFiles
        for (let i: number = 0; i < Seg1.length; i++) {

          let pathToShow = Seg1[i]['filePath'];
          pathToShow = pathToShow.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID) + "/", "");
         //  pathToShow = pathToShow.replace("C:\\AE_HOME\\Ftp_Location\\1\\", "");

          obj13[i] = { "filePath": pathToShow, "fileName": Seg1[i]['fileName'], 'blId': Seg1[i]['refrenceId'] }

          a11.push(obj13[i])
        }
        this.data = a11

        let c: Column[] = this.grid.getColumns();
        c[0].visible = true;
        c[1].visible = true;
        c[2].visible = false;
        c[3].visible = true;
        c[4].visible = true;
        c[5].visible = true;
        c[6].visible = false;
        c[7].visible = false;
        c[8].visible = false;
        c[9].visible = false;
        c[10].visible = true;
        c[11].visible = true;
        c[12].visible = true;
        c[13].visible = false;
        c[14].visible = false;
        c[15].visible = false;
        c[16].visible = false;
        c[17].visible = false;
        c[18].visible = false;
        c[19].visible = false;
        c[20].visible = false;
        c[21].visible = false;
        c[22].visible = false;
        c[23].visible = false;
        c[24].visible = false;
        c[25].visible = false;
        this.grid.refreshColumns();


      }
    )

  }

  parentRefrenceIdDropDown() {

    for (let i = 0; i <= 10000; i++) {
      this.parentReferenceDropDownData1[i] = 999 + i + "";
    }

    this.parentReferenceDropDownData1.push("  Parent not found");
    this.dpParams = {
      create: () => {
        this.elem = document.createElement("input");
        (this.elem as any).name = "parentReferenceId";
        return this.elem;
      },
      read: () => {
        return this.dropObj.value;
      },
      destroy: () => {
        this.dropObj.destroy();
      },
      write: (args: { rowData: object; column: any }) => {
        this.dropObj = new DropDownList({
          dataSource: this.parentReferenceDropDownData1,
          value: args.rowData[args.column.field],
          fields: { value: 'parentReferenceId', text: 'parentReferenceId' },
          allowFiltering: true,
          ignoreAccent: true,
          filterBarPlaceholder: 'e.g: 10001'

        });
        this.dropObj.appendTo(this.elem);
      }
    };

  }


  onRunMatchupClick(event) {

    this.matchupTemplateDialog.hide();
    this.isDisable = true;
    this.isDisableGrid = true;

    var parentAgreementType = event.form.value.parentAgreementType;
    var childAgreementType = event.form.value.childAgreementType;
    var parentDocument = event.form.value.parentDocument;

    let content = {
      "childAgreementType": event.form.value.childAgreementType,
      "parentAgreementType": event.form.value.parentAgreementType,
      "parentDocument": event.form.value.parentDocument
    }

    this.groupOptions = { columns: [] };
    this.data = [];
    // If statement logig to hide columns in the grid.
    if (this.grid != null && this.grid != undefined) {
      let c: Column[] = this.grid.getColumns();
      c[0].visible = false;
      c[1].visible = true;
      c[2].visible = true;
      c[3].visible = true;
      c[4].visible = false;
      c[5].visible = false;
      c[6].visible = false;
      c[7].visible = false;
      c[8].visible = false;
      c[9].visible = false;
      c[10].visible = false;
      c[11].visible = false;
      c[12].visible = false;
      c[13].visible = false;
      c[14].visible = false;
      c[15].visible = false;
      c[16].visible = true;
      c[17].visible = true;
      c[18].visible = true;
      c[19].visible = true;
      c[20].visible = true;
      c[21].visible = true;
      c[22].visible = false;
      c[23].visible = false;
      c[24].visible = false;
      c[25].visible = false;
      this.grid.refreshColumns();
    }

    // this.masterTrackerCreatorService.getDataBasedStatus().subscribe(dataList => {
    //   this.masterMatchUpAddendum = dataList;
    //   for (let i = 0; i < this.masterMatchUpAddendum.length; i++) {
    //     this.masterMatchUpAddendum[i]["blId"] = this.masterMatchUpAddendum[i].refrenceId;
    //   }
    //   this.data = this.masterMatchUpAddendum;
    // })

    if (parentDocument == "") {
      parentDocument = "no";
    }
    this.masterTrackerCreatorService.getVerifiedDataBasedOnUserConditions(parentAgreementType, childAgreementType, parentDocument).subscribe(dataList => {
      this.masterMatchUpAddendum1 = dataList;
      for (let i = 0; i < this.masterMatchUpAddendum1.length; i++) {
        this.masterMatchUpAddendum1[i]["blId"] = this.masterMatchUpAddendum1[i].refrenceId;
      }
      this.data = this.masterMatchUpAddendum1;
    })
  }

  // Getting Data for parent child mapup filter
  getAgreementTypeDataForMasterMatchup() {
    this.toolService.GetRelevantAgrrementType().subscribe(response => {
      if (response != null) {
        this.agreementTypeDatas = response
        this.agreementTypeDatas.forEach(data => {
          this.agreementTypeDatas1.push(data.agreementType);
        })
      } else {
        console.log('Data not fount');
      }
    });

  }
  getMasterTrackerData123() {
    this.data = [];
    let arr: {};
    let obj = [];
    this.masterTrackerCreatorService.masterTrackerFileView(this.company_id).subscribe(
      response => {
        this.grid.hideSpinner();
        this.data = response['masterTracker'];
        var a = [];
        var b;
        var ocrstaus = "";
        if (this.data && this.dBFiles) {
          for (let n = 0; n < this.data.length; n++) {
            // for (var j = 0; j < this.dBFiles.length; j++) {
            //   console.log(this.data[n].filePath+"*************this.data[n].filePaththis.data[n].filePath Line 227")
            //   console.log(this.dBFiles[j].path+"************this.dBFiles[j].paththis.dBFiles[j].path  line 228")
            //   if (this.data[n].filePath === this.dBFiles[j].path) {
            //     ocrstaus = this.dBFiles[j].ocrStatus;
            //   }
            // }
            b = this.data[n].filePath;
            //FOR SERVER
           b = b.replace("/data/aesoft/AE_HOME/Ftp_Location/" + sessionStorage.getItem(COMPANY_ID) + "/", "");
            //FOR local
           //  b = b.replace("C:\\AE_HOME\\Ftp_Location\\1\\", "");
           //for local
          //  var filenameind: number = this.data[n].fileName.lastIndexOf("\\") +1
          //   var filenametoShow  =   this.data[n].fileName.substring(filenameind)

            var filenameind: number = this.data[n].fileName.lastIndexOf("/") +1
            var filenametoShow  =   this.data[n].fileName.substring(filenameind)
            obj[n] = {
              "blId": this.data[n].blId, "filePath": b, "fileName": filenametoShow , "date": this.data[n].date, "fileExtension": this.data[n].fileExtension, "fileType": this.data[n].fileType,
              "fileSizeInKb": this.data[n].fileSizeInKb, "OCRStatus": ocrstaus, "extractionSourceFolder": this.data[n].extractionSourceFolder, "extractionStatus": this.data[n].extractionStatus, "ConvertedStatus": this.data[n].convertedStatus
            }
            a.push(obj[n]);

          }
          this.data = a;
        }


      })

  }
}









<div class="control-section" *ngIf="isDisableGrid">
  <ejs-grid #grid [dataSource]=' data' [allowPaging]="true" [toolbar]='toolbar' showColumnChooser='true'
    [editSettings]='editSettings' (toolbarClick)='toolbarClick($event)' [allowGrouping]="true" [allowResizing]="true"
    [filterSettings]='filterOptions' [pageSettings]='pageSettings' [groupSettings]='groupOptions'
    [selectionSettings]='selectOptions' [allowFiltering]='true' (rowSelected)='rowSelectedFindDuplicate($event)'
    (rowSelecting)='rowSelecting($event)' (rowDeselected)='rowDeSelectedFindDuplicate($event)'
    [contextMenuItems]='contextMenuItems' (contextMenuClick)='contextMenuClick($event)'
    (contextMenuOpen)="contextMenuOpen($event)" [allowSelection]="true" (actionBegin)="actionBegin($event)"  (select)='onSelect($event)'>
    <e-columns>
      <!-- <e-column type='checkbox' width='50'></e-column> -->
      <e-column type='checkbox' width='50' [allowEditing]="false"></e-column>
      <e-column field='blId' headerText='Reference Id' width='100' [allowEditing]="false"></e-column>


      <e-column id='diacritics' field='parentReferenceId' headerText='Parent Reference Id' editType='dropdownedit'
        [edit]='dpParams' [allowFiltering]='true' [ignoreAccent]='true' filterBarPlaceholder='e.g: 10001'>
      </e-column>

      <!-- <e-column headerText='parentReferenceId' editType='dropdownedit'>
        <ng-template #template let-data>
          <ejs-dropdownlist id='diacritics' value={{data.parentReferenceId}} [dataSource]='parentReferenceDropDownData1'
            [allowFiltering]='true' [ignoreAccent]='true' filterBarPlaceholder='e.g: 10001'></ejs-dropdownlist>
        </ng-template>
      </e-column> -->


      <e-column field='fileName' headerText='File Name' width='180' [allowEditing]="false"></e-column>
      <e-column field='filePath' headerText='File Path' width='180' [allowEditing]="false"></e-column>
      <e-column field='fileExtension' headerText='File Extension' width='100' [allowEditing]="false"></e-column>
      <e-column field='ConvertedStatus' headerText='Converted Status' width='100' [allowEditing]="false"></e-column>
      <e-column field='date' headerText='Date' width='180' [allowEditing]="false"></e-column>
      <e-column field='fileType' headerText='File Type' width='100' [allowEditing]="false"></e-column>
      <e-column field='fileSizeInKb' headerText='File Size(Kb)' width='100' [allowEditing]="false"></e-column>
      <e-column field='OCRStatus' headerText='OCR Status' width='180' [allowEditing]="false"></e-column>
      <e-column field='Seg Status' headerText='Segregation Status' width='180' [allowEditing]="false"></e-column>
      <e-column field='Execution Status' headerText='Execution Status' width='100' [allowEditing]="false"></e-column>
      <e-column field='Qc1 Status' headerText='Qc1 Status' width='100' [allowEditing]="false"></e-column>
      <e-column field='Qc2 Status' headerText='Qc2 Status' width='100' [allowEditing]="false"></e-column>
      <e-column textAlign='Left' width='170' field='' headerText='Action1' [allowEditing]="false">
        <ng-template #template let-data>
          <div style="float: Left;">

            <a><img (click)="viewPDF($event,data,PDFtemplate)" src="assets/images/profile/view_copy.png"></a>&nbsp;
            <a *ngIf="data.isDuplicate =='Yes'"><img src="assets/images/profile/copy_mark.png"></a>
            <a (click)="enableEditing($event,data,template,'duplicateByName')" *ngIf="data.isDuplicate =='No'"><img
                src="assets/images/profile/copy_unmark.png"></a>
            <a (click)="undoDuplicate($event,data)" *ngIf="data.isDuplicate =='Yes'"><img
                src="assets/images/profile/undo_btn.png"></a>
          </div>

        </ng-template>

      </e-column>

      <!-- Master matchup addendum fields. -->
      <e-column field='agreementType' headerText='Agreement Type' width='100' [allowEditing]="false"></e-column>
      <e-column field='typeOfDocument' headerText='Parent Agreement Type' width='100' [allowEditing]="false">
      </e-column>
      <e-column field='firstParty' headerText='First Party' width='100' [allowEditing]="false"></e-column>
      <e-column field='counterParty' headerText='Counter Party' width='100' [allowEditing]="false"></e-column>
      <e-column field='effectiveDate' headerText='Effective Date' width='100' [allowEditing]="false"></e-column>
      <e-column field='masterEffectiveDate' headerText='Parent Effective Date' width='100' [allowEditing]="false">
      </e-column>
      <e-column field='fileNameWithout' headerText='FileNameWithoutExtension' width='120' [allowEditing]="false"></e-column>
      <e-column textAlign='Left' width='170' field='' headerText='Action2' [allowEditing]="false">
        <ng-template #template let-data>
          <div style="float: Left;">

            <a><img (click)="viewPDF($event,data,PDFtemplate)" src="assets/images/profile/view_copy.png"></a>&nbsp;
            <a *ngIf="data.isDuplicate =='Yes'"><img src="assets/images/profile/copy_mark.png"></a>
            <a (click)="enableEditing($event,data,contentTemplate,'duplicateByContent')"
              *ngIf="data.isDuplicate =='No'"><img src="assets/images/profile/copy_unmark.png"></a>
            <a (click)="undoDuplicateContent($event,data)" *ngIf="data.isDuplicate =='Yes'"><img
                src="assets/images/profile/undo_btn.png"></a>
          </div>

        </ng-template>

      </e-column>
      <e-column field='extractionSourceFolder' headerText='Extraction SourceFolder ' width='100' [allowEditing]="false">
      </e-column>
      <e-column field='extractionStatus' headerText='Extraction Status ' width='100' [allowEditing]="false">
      </e-column>
    </e-columns>
  </ejs-grid>
</div>
<ng-template #toolbarTemplate11 let-data11>
  <!-- <button ejs-dropdownbutton [items]='items11' (select)='onSelect($event)' content='Edit Options'></button>`  -->
  <span class="msdropdown-label">Filter By:</span>
  <ejs-dropdownlist id='ddlelement' [dataSource]='datadropdown' [(value)]='valueDropDown'
    (change)="onChangeOfDropDown($event)"></ejs-dropdownlist>
</ng-template>

<ng-template #toolbarTemplate let-data>
  <button ejs-dropdownbutton [items]='items' (select)='onSelect($event)' content='Find Duplicate'></button>`
</ng-template>


<!-- <app-update-master-tracker></app-update-master-tracker> -->
<!-- For mark duplicate by Name-->
<ejs-dialog showCloseIcon='true' #FindByNameTemplate class="dialog-custom" isModal='true' [visible]='false'>

  <ng-template #header>
    <h4> Mark as Duplicate</h4>

  </ng-template>

  <ng-template #content>
    <h6>Select Reference ID of file which it is duplicate</h6>
    <div class="row">
      <ejs-grid [dataSource]='duplicateData' [allowResizing]="true" (rowSelected)='rowSelectedForDuplicate($event)'
        (rowDeselected)='rowDeSelectedForDuplicate($event)'>
        <e-columns>
          <e-column field='blId' headerText='Reference Id' width=90></e-column>
          <e-column field='fileName' headerText='File Name' width='180'></e-column>
          <e-column field='filePath' headerText='File Path' width='180'></e-column>
        </e-columns>
      </ejs-grid>`
    </div>
  </ng-template>

  <ng-template #footerTemplate>
    <button ejs-button cssClass="e-info" (click)="onDuplicateClick(template)">OK</button>
    <button ejs-button (click)="onCancelClick(template)">CLOSE</button>
  </ng-template>
</ejs-dialog>
<!-- <ejs-dialog [content]="contentData" [buttons]="buttons" [width]="dialogWidth"> </ejs-dialog> -->
<!-- For View PDF -->
<ejs-dialog showCloseIcon='true' #PDFtemplate class="dialog1-custom" isModal='true' [visible]='false'>
  <ng-template #header>
    {{viewDocumentName}}
  </ng-template>

  <ng-template #content>
    <div id="pdfViewerDynamic" class="pdf-container" style="width: 850px important;">
      <ngx-extended-pdf-viewer [src]="currentPdf" height="160vh" [showPrintButton]="false" [showOpenFileButton]="false"
        [showBookmarkButton]="false" [showDownloadButton]="false" useBrowserLocale="true" [showHandToolButton]="true"
        [handTool]="false" [ignoreKeys]="['CTRL+S']">
      </ngx-extended-pdf-viewer>
    </div>
  </ng-template>

  <ng-template #footerTemplate>
  </ng-template>
</ejs-dialog>
<!-- For view two documents -->
<ejs-dialog showCloseIcon='true' #comparePDFTemplate class="dialog-customPdf" isModal='true' [visible]='false'>
  <ng-template #header>

  </ng-template>

  <ng-template #content>
    <div class="row">
      <div class="col-md-6" style="height:600px;">
        <h3>FilePath:{{name}}</h3>
        <ng2-pdfjs-viewer [print]='false' [download]='false' [openFile]='false' #myPdfViewer1></ng2-pdfjs-viewer>
      </div>
      <div class="col-md-6" style="height:600px;">
        <h3>FilePath:{{name1}}</h3>
        <ng2-pdfjs-viewer [print]='false' [download]='false' [openFile]='false' #myPdfViewer2></ng2-pdfjs-viewer>
      </div>
    </div>
  </ng-template>

  <ng-template #footerTemplate>

  </ng-template>
</ejs-dialog>

<ejs-dialog showCloseIcon='true' #contentTemplate class="dialog-custom" isModal='true' [visible]='false'>

  <ng-template #header>
    <h4> Mark as Duplicate</h4>

  </ng-template>

  <ng-template #content>
    <h6>Select Reference ID of file which it is duplicate</h6>
    <div class="row">
      <ejs-grid [dataSource]='duplicateData' [allowResizing]="true" (rowSelected)='rowSelectedForDuplicate($event)'
        (rowDeselected)='rowDeSelectedForDuplicate($event)'>
        <e-columns>
          <e-column field='blId' headerText='Reference Id' width=90></e-column>
          <e-column field='fileName' headerText='File Name' width='180'></e-column>
          <e-column field='filePath' headerText='File Path' width='180'></e-column>
        </e-columns>
      </ejs-grid>`
    </div>
  </ng-template>

  <ng-template #footerTemplate>
    <button ejs-button cssClass="e-info" (click)="onDuplicateClickContent(contentTemplate)">OK</button>
    <button ejs-button (click)="onCancelClick(contentTemplate)">CLOSE</button>
  </ng-template>
</ejs-dialog>

<div #container class='root-container'>
  <ejs-dialog showCloseIcon='true' #ejDialog class="dialog-custom" isModal='true' [visible]='false'>

    <ng-template #header>
      <h4> View Files</h4>

    </ng-template>

    <ng-template #content>
      <h6>Following files are present in the selected Zip file </h6>
      <div class="row">
        <ejs-grid [dataSource]='dataInZip' [allowPaging]="true" [pageSettings]='pageSettings1' [allowResizing]="true"
          height=250>
          <e-columns>
            <!-- <e-column field='blId' headerText='Reference Id' width=90></e-column>  -->
            <e-column field='filename' headerText='File Name' width='180'></e-column>
            <e-column field='filepath' headerText='File Path' width='180'></e-column>
            <e-column field='filesize' headerText='File Size' width='180'></e-column>
          </e-columns>
        </ejs-grid>`
      </div>
    </ng-template>

    <!-- <ng-template #footerTemplate>
    <button ejs-button cssClass="e-info" >OK</button>
    <button ejs-button >CLOSE</button>
  </ng-template>  -->
  </ejs-dialog>
</div>



<div #containerForCreateBatch class='root-container'>
  <ejs-dialog showCloseIcon='true' id='dialog' #ejDialogForCreateBatch isModal='true' header='Create Batches'
    [target]='targetElement' width='300px' [visible]='false'>
    <form id="template_driven1" #selectCompanyForm="ngForm" novalidate>
      <ng-template #content>
        <div className="login-form">
          <div class="wrap">
            <ejs-radiobutton label="With number of Batches" name="custom" [(ngModel)]="favoritebatchStyle1"
              value='WithBatchSize' cssClass="e-primary"></ejs-radiobutton>

            <div *ngIf="favoritebatchStyle1==='WithBatchSize'" class='textboxes'>
              <div class="form-group">
                <div class="e-float-input">
                  <input type="number" id="noOfBatches" placeholder="Enter number Of Batches" #noOfBatches='ngModel'
                    name="noOfBatches" (blur)="validatenoOfBatches(noOfBatches)" min="1" required ngModel>
                </div>
                <p *ngIf="showZeroMessage" class="text-danger">Entered number should be greater than 0 </p>
                <p *ngIf="showtotalFilesMessage" class="text-danger">Entered number should be less than or equal to
                  total file's count </p>
              </div>
            </div>
            <br>
            <br>
            <br>
            <br>
            <ejs-radiobutton label="With number of files in each batch" name="custom" [(ngModel)]="favoritebatchStyle1"
              value='WithAvailableSize' cssClass="e-primary"></ejs-radiobutton>
            <div *ngIf="favoritebatchStyle1==='WithAvailableSize'" class='textboxes'>
              <div class="e-float-input">
                <input type="number" id="noOffiles" placeholder="Enter number of files in each batch"
                  (blur)="validatenoOffiles(noOffiles)" #noOffiles='ngModel' name="noOffiles" min="1" required ngModel>
              </div>
              <p *ngIf="showZeroMessage1" class="text-danger">Entered number should be greater than 0 </p>
              <p *ngIf="showtotalFilesMessage1" class="text-danger">Entered number should be less than or equal to
                total file's count </p>

            </div>

            <br>
            <br>
            <br>
            <br>
            <button class="submit-btn e-btn" id="submit-btn" [disabled]="selectCompanyForm.invalid" type="reset"
              (click)="BatchTypeNO(selectCompanyForm ,noOfBatches)">OK</button>
          </div>
        </div>
      </ng-template>
    </form>
  </ejs-dialog>

</div>

<div #containerForCreateBatches class='root-container'>

  <ejs-dialog showCloseIcon='true' id='dialog' #ejDialogForCreateBatches isModal='true' header='Create Batches'
    [target]='targetElement' width='300px' [visible]='false'>
    <form id="template_driven1" #selectForm="ngForm" novalidate>
      <ng-template #content>
        <div className="login-form">
          <div class="wrap">
            <ejs-radiobutton label="With number of Batches" name="custom" [(ngModel)]="favoritebatchStyle"
              value='WithBatchSize' cssClass="e-primary"></ejs-radiobutton>

            <div *ngIf="favoritebatchStyle==='WithBatchSize'" class='textboxes'>
              <div class="form-group">
                <div class="e-float-input">
                  <input type="number" id="noOfBatchesforOCR" placeholder="Enter number Of Batches"
                    #noOfBatches='ngModel' name="noOfBatchesforOCR" (blur)="validatenoOfBatchesocr(noOfBatchesforOCR)"
                    min="1" required ngModel>
                </div>
                <p *ngIf="showZeroMessage" class="text-danger">Entered number should be greater than 0 </p>
                <p *ngIf="showtotalFilesMessage" class="text-danger">Entered number should be less than or equal to
                  total file's count </p>
              </div>
            </div>
            <br>
            <br>
            <br>
            <br>
            <ejs-radiobutton label="With number of files in each batch" name="custom" [(ngModel)]="favoritebatchStyle"
              value='WithAvailableSize' cssClass="e-primary"></ejs-radiobutton>
            <div *ngIf="favoritebatchStyle==='WithAvailableSize'" class='textboxes'>
              <div class="e-float-input">
                <input type="number" id="noOffilesforOCR" placeholder="Enter number of files in each batch"
                  (blur)="validatenoOffilesOcr(noOffilesforOCR)" #noOffilesforOCR='ngModel' name="noOffilesforOCR" min="1"
                  required ngModel>
              </div>
              <p *ngIf="showZeroMessage1" class="text-danger">Entered number should be greater than 0 </p>
              <p *ngIf="showtotalFilesMessage1" class="text-danger">Entered number should be less than or equal to
                total file's count </p>
            </div>
            <br>
            <br>
            <br>
            <br>
            <button class="submit-btn e-btn" id="submit-btn" [disabled]="selectForm.invalid" type="reset"
              (click)="createBatchesforOCR(selectForm ,noOfBatchesforOCR)">OK</button>
          </div>
        </div>
      </ng-template>
    </form>
  </ejs-dialog>

</div>



<div #containerForCreateBatchExecution class='root-container'>
  <ejs-dialog showCloseIcon='true' id='dialogExecution' #ejDialogForCreateBatchExecution isModal='true'
    header='Create Batches' [target]='targetElement' width='300px' [visible]='false'>
    <form id="template_driven1Execution" #selectCompanyFormExecution="ngForm" novalidate>
      <ng-template #content>
        <div className="login-form">
          <div class="wrap">
            <ejs-radiobutton label="With number of Batches" name="custom" [(ngModel)]="favoritebatchStyle1"
              value='WithBatchSize' cssClass="e-primary"></ejs-radiobutton>

            <div *ngIf="favoritebatchStyle1==='WithBatchSize'" class='textboxes'>
              <div class="form-group">
                <div class="e-float-input">
                  <input type="number" id="noOfBatchesExecution" placeholder="Enter number Of Batches"
                    #noOfBatches='ngModel' name="noOfBatchesExecution"
                    (blur)="validatenoOfBatchesExecution(noOfBatchesExecution)" min="1" required ngModel>
                </div>
                <p *ngIf="showZeroMessageExecution" class="text-danger">Entered number should be greater than 0 </p>
                <p *ngIf="showtotalFilesMessageExecution" class="text-danger">Entered number should be less than or
                  equal to total file's count </p>
              </div>
            </div>
            <br>
            <br>
            <br>
            <br>
            <ejs-radiobutton label="With number of files in each batch" name="custom" [(ngModel)]="favoritebatchStyle1"
              value='WithAvailableSize' cssClass="e-primary"></ejs-radiobutton>
            <div *ngIf="favoritebatchStyle1==='WithAvailableSize'" class='textboxes'>
              <div class="e-float-input">
                <input type="number" id="noOffilesExecution" placeholder="Enter number of files in each batch"
                  (blur)="validatenoOffilesExecution(noOffilesExecution)" #noOffiles='ngModel' name="noOffiles" min="1"
                  required ngModel>
              </div>
              <p *ngIf="showZeroMessage1Execution" class="text-danger">Entered number should be greater than 0 </p>
              <p *ngIf="showtotalFilesMessage1Execution" class="text-danger">Entered number should be less than or equal
                to total file's count </p>

            </div>

            <br>
            <br>
            <br>
            <br>
            <button class="submit-btn e-btn" id="submit-btnExecution" [disabled]="selectCompanyFormExecution.invalid"
              type="reset" (click)="BatchTypeNOExecution(selectCompanyFormExecution ,noOfBatches)">OK</button>
          </div>
        </div>
      </ng-template>
    </form>
  </ejs-dialog>

</div>


<ejs-dialog showCloseIcon='true' #matchupTemplateDialog width='600px' isModal='true' [visible]='false'>

  <form id="ngFormID" #runMatchup="ngForm" novalidate>
    <!-- <form #runMatchup="ngForm" (ngSubmit)="onRunMatchupClick(runMatchup)"> -->
    <!-- <form #AddFileForm="ngForm"> -->
    <div class="card">
      <div class="card-body">

        <ng-template #header>
          Parent-Child Relation Mapping
        </ng-template>

        <ng-template #content>

          <div fxFlexFill class="flex-container" fxLayout="row" fxLayout.xs="column" fxLayoutGap="20px"
            fxLayoutAlign="start" [style.margin-bottom]="'20px'">
            <div fxFlex class="child-1">
              <ejs-dropdownlist floatLabelType="Always" id='parentAgreementType' name="parentAgreementType"
                [dataSource]='agreementTypeDatas1' placeholder='Select Parent Document' popupHeight='200px' ngModel>
              </ejs-dropdownlist>
            </div>
            <div fxFlex class="child-2">
              <ejs-dropdownlist floatLabelType="Always" id='childAgreementType' name="childAgreementType"
                [dataSource]='agreementTypeDatas1' placeholder='Select Child Document' popupHeight='200px' ngModel>
              </ejs-dropdownlist>
            </div>
          </div>

          <div fxFlexFill class="flex-container" fxLayout="row" fxLayout.xs="column" fxLayoutGap="20px"
            fxLayoutAlign="start" [style.margin-bottom]="'20px'">
            <div fxFlex class="child-3">
              <ejs-dropdownlist floatLabelType="Always" id='parentDocument' name="parentDocument"
                [dataSource]='agreementTypeDatas1' placeholder='Select Child Parent Document' popupHeight='200px'
                ngModel>
              </ejs-dropdownlist>
            </div>
          </div>

        </ng-template>

        <ng-template #footerTemplate>
          <div style="text-align: center;">
            <button ejs-button cssClass="e-primary" content="Rum Matchup" type="submit"
              (click)="onRunMatchupClick(runMatchup)">Rum Matchup</button>
          </div>
        </ng-template>
      </div>
    </div>
  </form>
</ejs-dialog>
 

1 Reply

TS Thaneegairaj Sankar Syncfusion Team December 10, 2021 04:32 PM UTC

Hi Sunil,


Thanks for contacting Syncfusion support. 


We have checked your reported issue. We have rendered Context menu in Grid control using “toolbar” property and we can be able to trigger select event for context menu. For your reference we have created a sample with your provided code snippet, please find the below link


Link: https://stackblitz.com/edit/angular-ekft7w-ucmyrj?file=app.component.ts


Please check the sample and if you are still facing issue, kindly share the below details,


  • If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample.

  • If possible, please share the video demonstration for this issue.


Please provide the above requested information, based on that we will check and provide you a better solution quickly.


Regards,

Thaneegairaj S


Loader.
Up arrow icon