Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular ngx数据表中的ngFor_Angular_Forms_Reactive_Ngx Datatable - Fatal编程技术网

Angular ngx数据表中的ngFor

Angular ngx数据表中的ngFor,angular,forms,reactive,ngx-datatable,Angular,Forms,Reactive,Ngx Datatable,我有一个ngx数据表,它显示来自json对象的数据,其中包含行和项。 但我想向表中的输入字段添加表单验证器 我有单元格模板来显示每列的自定义字段。 我研究了在表中添加formcontrols时应该使用formarray 问题是,当为my字段的输入添加NGF时,会消失 <div [formGroup]="tableValidate"> <prx-card> <prx-card-body class="prx-card-body

我有一个ngx数据表,它显示来自json对象的数据,其中包含行和项。 但我想向表中的输入字段添加表单验证器

我有单元格模板来显示每列的自定义字段。 我研究了在表中添加formcontrols时应该使用formarray 问题是,当为my字段的输入添加NGF时,会消失

<div [formGroup]="tableValidate">
  <prx-card>
    <prx-card-body class="prx-card-body-pya">
      <ng-container *ngIf="usersTemplate && usersTemplate.length; else loadingList">
        <ngx-datatable
          class="listview responsive"
          [rows]="usersTemplate"
          [columns]="columns"
          [columnMode]="ColumnMode.force"
          headerHeight="auto"
          [rowHeight]="false"
          footerHeight="auto"
          [limit]="5"
          [selectionType]="SelectionType.checkbox"
          [selectAllRowsOnPage]="false"
          (select)="onSelect($event)"
          [summaryRow]="enableSummary"
          [summaryPosition]="summaryPosition"
          [summaryHeight]="0"
        >
          <ngx-datatable-footer>
            <ng-template
              ngx-datatable-footer-template
              let-rowCount="rowCount"
              let-pageSize="pageSize"
              let-selectedCount="selectedCount"
              let-curPage="curPage"
              let-offset="offset"
            >
              <div style="padding: 5px 10px">
                <div>
                  <strong>Totales</strong>: Lunes: {{ totalLunes }} | Martes: {{ totalMartes }} | Miércoles:
                  {{ totalMiercoles }} | Jueves: {{ totalJueves }} | Viernes: {{ totalViernes }}
                </div>
                <hr style="width: 100%" />
                <div>Filas: {{ rowCount }} | Página actual: {{ curPage }} | Seleccionados: {{ selectedCount }}</div>
              </div>
            </ng-template>
          </ngx-datatable-footer>
        </ngx-datatable>
      </ng-container>

      <ng-template #loadingList>
        <prx-loader template="list" [isLoading]="isLoading" [count]="2"></prx-loader>
      </ng-template>
    </prx-card-body>
  </prx-card>
  <!--SELECT-->
  <ng-template #selectTemplate let-value="value" let-row="row" let-column="column" let-rowIndex="rowIndex">
    <div class="pya-cell">
      <small class="text-muted d-block d-lg-none">{{ column.name }}</small>
      <span
        *ngIf="!appearSelectColumn[rowIndex][column.name]"
        (dblclick)="appearSelect(rowIndex, column.name, value)"
        >{{ value }}</span
      >
      <label *ngIf="appearSelectColumn[rowIndex][column.name]">
        <select class="form-control form-control-sm">
          <option *ngFor="let option of options">{{ option.nombre }}</option>
        </select>
      </label>
    </div>
  </ng-template>
  <ng-template formArrayName="filas"
               *ngFor="let filas of filasValidator.controls; let i = index"
               #inputTemplate
               let-value="value"
               let-row="row"
               let-column="column"
               let-rowIndex="rowIndex">
    <label [formGroupName]="i" class="pya-cell">
      <small class="text-muted d-block d-lg-none">{{ column.name }}</small>
      <!--REVISAR VALUE, DA ERROR DE REASIGNACION -->
      <input
        (input)="editHour(rowIndex, column.prop, $event)"
        formControlName="dia"
        type="number"
        value="{{ value }}"
        class="number text-center w-50 form-control light"
      />
    </label>
  </ng-template>
  <!--CHECKBOX-->
  <ng-template
    #checkboxTemplate
    let-column="column"
    let-isSelected="isSelected"
    let-onCheckboxChangeFn="onCheckboxChangeFn"
  >
    <label class="pya-cell">
      <small class="text-muted d-block d-lg-none">{{ column.name }}</small>
      <prx-checkbox [checked]="isSelected" (onChanged)="onCheckboxChangeFn($event)"></prx-checkbox>
    </label>
  </ng-template>
  </div>

总计:Lunes:{{totalmunes}}Martes:{{{totalMartes}}}Miércoles:
{{totalMiercoles}{Jueves:{{{totalJueves}}}Viernes:{{{totalViernes}}

菲拉斯:{{rowCount}}{Página实际:{{curPage}}{Seleccionados:{{selectedCount}} {{column.name} {{value}} {{option.nombre}} {{column.name} {{column.name}