簡體   English   中英

如何從特定的 td PrimeNG 中禁用 selectableRow

[英]How to disable selectableRow from an specific td PrimeNG

我有一個表格,我想在其中被選中並被帶到另一個視圖,最后一行的表格有一個復選框,我想做的是如果我選擇了我不想被帶到另一個的復選框查看,只是要選中的復選框。

 <p-table #tablaArticulosPendientesTif
    [value]="listaArticulosPendientesTif"
    responsiveLayout="scroll"
    dataKey="llaveTabla"
    [paginator]="true"
    scrollDirection="horizontal"
    styleClass="p-datatable-striped"
    [paginator]="true"
    [rows]="paginator.rows"
    [totalRecords]="paginator.totalRecords"
    [rowsPerPageOptions]="[10, 20, 50]"
    [showCurrentPageReport]="true"
    currentPageReportTemplate="Mostrando del {first} al {last} de {totalRecords} registros"
    [lazy]="true"
    selectionMode="single"
    (onRowSelect)="onRowSelect($event)"
    (onLazyLoad)="loadData($event)">
  
      <ng-template pTemplate="header">
        <tr class="fondoTablaPincipal">
          <th>{{'codigo' | translate}}</th>
          <th>{{'descripcion' | translate}}</th>
          <th>{{'almacen' | translate}}</th>
          <th>{{'tipotif' | translate}}</th>
          <th>{{'fechareferencia' | translate}}</th>
          <th>{{'diasrotacion' | translate}}</th>
          <th>{{'diasperiodico' | translate}}</th>
          <th>{{'numeromovimientos' | translate}}</th>
          <th>{{'contadormovimientos' | translate}}</th>
          <th>{{'nivelinventario' | translate}}</th>
          <th>{{'fechaultimotif' | translate}}</th>
          <th>{{'observacion' | translate}}</th>
          <th>{{'seleccionar' | translate}}</th>
        </tr>
      </ng-template>
  
      <ng-template pTemplate="body" let-articulotif>
        <tr [pSelectableRow]="articulotif">
          <td>{{articulotif.codigoArticulo}}</td>
          <td>{{articulotif.nombreArticulo}}</td>
          <td>{{articulotif.nombreAlmacen}}</td>
          <td>{{listaTif[articulotif.tipoTif]}}</td>
          <td>{{articulotif.fechaReferencia | date: ('formatofecha' | translate)}}</td>
          <td>{{articulotif.diasRotacion}}</td>
          <td>{{articulotif.diasPeriodico}}</td>
          <td>{{articulotif.numeroMovimientos}}</td>
          <td>{{articulotif.contadorMovimientos}}</td>
          <td>{{articulotif.nivelInventario}}</td>
          <td>{{articulotif.fechaUltimoTif | date: ('formatofecha' | translate)}}</td>
          <td>{{articulotif.observacion}}</td>
          <td>
            <div class="field-checkbox">
              <p-checkbox [(ngModel)]="articulotif.requieretif" [binary]="true"></p-checkbox>
            </div>
          </td>
        </tr>
      </ng-template>
    </p-table>

我試圖取出復選框行,但沒有成功

要禁用 selectableRow,請嘗試使用pSelectableRowDisabled

<tr [pSelectableRow]="articulotif" [pSelectableRowDisabled]="your_disable_condition">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM