移动页面然后返回时,未选中复选框(作为选定行)

 收藏

在我的表格中,我有一列用于复选框的行选择。在页面1中,当我选中其中一个复选框时,页脚会显示已选择1。当我移至页面2并返回到页面1时,页脚仍选择了1,但未选中任何复选框。

<ngx-datatable class="material striped scroll-vertical center"
      style="width: 90%"
      #table
      [rows]="rows"
      [loadingIndicator]="loadingIndicator"
      [columnMode]="'force'"
      [headerHeight]="48"
      [footerHeight]="56"
      [rowHeight]="'auto'"
      [rowClass]="setRowClass"
      [scrollbarH]="true"
      [externalPaging]="true"
      [count]="totalRows"
      [offset]="dataTable.pages?.offset"
      [limit]="dataTable.pages?.limit"
      [externalSorting]="true"
      (page)="setPage($event)"
      (sort)="setSort($event)"
      [selected]="selected"
      [selectionType]="'checkbox'"
      [selectAllRowsOnPage]="false"
      (select)='onSelect($event)'> 

     <!--checkbox-->
     <ngx-datatable-column prop='selected'
                name= ''
                [sortable] = "false"
                [canAutoResize]= "false"
                [draggable]= "false"
                [resizeable]= "false"
                [headerCheckboxable]="true"
                [checkboxable]= "true"
                [width]="10">
     </ngx-datatable-column>

     <ngx-datatable-column name="RS Number"
                    prop="TrxNum"
                    [width]="15"
                    [sortable] = "false">
                    <ng-template ngx-datatable-cell-template let-value="value">
                    {{value}}
                    </ng-template>
        </ngx-datatable-column>
</ngx-datatable>

一切正常,只有选中的复选框,并且在移动并返回页面后,该复选框变为未选中状态。

回复