Angular2 - 剑道网格 kendoGridCellTemplate

问题描述 投票:0回答:0

我有一个带有分页和 kendo-grid-checkbox-column 的 Kendo-Grid,

我希望能够根据后端数据检查复选框。

虽然 [kendoGridSelectionCheckbox] 与 [checked] 结合使用似乎是不可能的。

`

    

  <kendo-grid #factoring
                  [data]="factoringSites"
                  [pageSize]="factoringSitesPageSize"
                  [skip]="skipFactoring"
                  [pageable]="true"
                  (pageChange)="pageChange($event, 'factoring')"
                  [height]="300"
                  [selectable]="{enabled: true, checkboxOnly: true }"
                  kendoGridSelectBy="id"
                  [(selectedKeys)]="myFactoringSitesSelection"
                  (selectedKeysChange)="onSelectedKeysChange($event, 'factoring')"
                  disabled="!factoringChecked">
        <kendo-grid-checkbox-column [width]="40">
          <ng-template kendoGridHeaderTemplate let-dataItem>
            <input type="checkbox" kendoCheckBox id="selectAllFactoringCheckboxId" kendoGridSelectAllCheckbox
                   [state]="selectAllFactoringState"
                   (selectAllChange)="onSelectAllChange($event, 'factoring')"
                   [disabled]="selectAllReverseFactoringState == 'checked'">
            <label class="k-checkbox-label" for="selectAllFactoringCheckboxId"></label>
          </ng-template>
          <ng-template kendoGridCellTemplate let-dataItem let-factoringidx="rowIndex">
            <input type="checkbox"
                   kendoCheckBox
                   [kendoGridSelectionCheckbox]="factoringidx"
[checked]="true"
                   (change)="selectionChangeHandler($event, dataItem,'factoring')"
                  />
          </ng-template>
        </kendo-grid-checkbox-column>

选择没有 [kendoGridSelectionCheckbox] 的复选框会选择下一页中放置的相同行,即使该行的索引完全不同..

那么我怎样才能使用两者的组合,或者只是不选择下一页的行

示例-https://stackblitz.com/edit/angular-rssxbc

kendo-ui kendo-grid kendo-ui-angular2
© www.soinside.com 2019 - 2024. All rights reserved.