<div class="mb-2" [style]="height">
  @if (childWindowOpened) {
    <div class="k-overlay"></div>
  }
  <ngx-spinner bdColor = "rgba(0,0,0,0.8)" color="#fff" size="default" type="ball-spin-clockwise" [fullScreen]="true">
    <p style="color:white;">Working on your request, please wait.... </p>
  </ngx-spinner>

  @if ((gridView && gridView.total)) {
    <div class="col-lg-12 col-md-12 col-sm-12 items-summary">
      Total: {{gridView.total}}
      @if(selectedIds?.length)
        {
        <span style="float:right;">Selected: {{selectedIds.length}}</span>
      }
    </div>
  }
  <div class="col-lg-12 col-md-12 col-sm-12 mt-2">
    <kendo-grid [data]="gridView"
      [resizable]="true"
      [sort]="state.sort"
      [loading]="loading"
      [(selectedKeys)]="selectedIds"
      [kendoGridSelectBy]="selectedKeys"
      [sortable]="{allowUnsort:true,mode:'single'}"
      [selectable]="{enabled:true,checkboxOnly:true}"
      (dataStateChange)="dataStateChange($event)"
      class="grid-font-900"
      [style]="gridHeight">
      <kendo-grid-checkbox-column [showSelectAll]="true" [width]="40" [style]="{'text-align':'center'}"></kendo-grid-checkbox-column>
      @for (column of columns; track column) {
        <kendo-grid-column
          [field]="column.field"
          [title]="column.title"
          [width]="column.width"
          [headerStyle]="{'font-weight':'bold'}">
        </kendo-grid-column>
      }
    </kendo-grid>
  </div>
</div>

<div class="k-window-footer-free">
  @if (statusToUpdate!==16) {
    <button type="button" class="btn btn-primary btn-sm ms-1 kwf-button" title="{{processName}}" (click)="okay()" [disabled]="!selectedIds?.length"><i class="fa fa-check" aria-hidden="true"></i>&nbsp;{{processName}}</button>
  }
  @if (statusToUpdate===16) {
    <button type="button" class="btn btn-danger btn-sm ms-1 kwf-button" title="{{processName}}" (click)="deactivate()" [disabled]="!selectedIds?.length"><i class="fa fa-remove" aria-hidden="true"></i>&nbsp;{{processName}}</button>
  }
  @if (statusToUpdate!==16) {
    <button type="button" class="btn btn-danger btn-sm me-2 position-absolute end-0 kwf-button" title="Reject" (click)="reject()" [disabled]="!selectedIds?.length"><i class="fa fa-reply" aria-hidden="true"></i>&nbsp;Reject</button>
  }
</div>
