问题描述
在服务器驱动的分页中更改页面时,导致
clrDgRefresh似乎被触发两次,导致当前页面设置为0,而不是下一页。
refresh(state: ClrDatagridStateInterface) {
this.loading = true;
this.pagedRegistriesData = this.rawRegistriesData.slice(state.page.from,state.page.to);
// checking if we have the values of interest cached. if not we retrieve them.
if (this.pagedRegistriesData.includes(null) || this.pagedRegistriesData.length == 0) {
this.getRegistries(state);
} else {
this.loading = false;
}
}
<clr-dg-row *ngFor="let rgn of pagedRegistriesData">
<clr-dg-cell>{{rgn.ControlAccountId}}</clr-dg-cell>
<clr-dg-cell>{{rgn.AccountId}}</clr-dg-cell>
<clr-dg-cell>{{rgn.CloudHubRegion}}</clr-dg-cell>
<clr-dg-cell>{{rgn.CloudHubVersion}}</clr-dg-cell>
<clr-dg-cell>{{rgn.PrevIoUsCloudHubVersion}}</clr-dg-cell>
<clr-dg-cell>{{rgn.RegionStatus}}</clr-dg-cell>
<clr-dg-cell>{{rgn.Environment}}</clr-dg-cell>
<clr-dg-cell>{{rgn.CloudHubStatusUpdateTime}}</clr-dg-cell>
<clr-dg-cell>
<button class="btn btn-link btn-sm btn-icon" (click)="openLogStreamModal(rgn)">
<clr-icon shape="file-group" class="is-solid"></clr-icon>
</button>
</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} of {{totalRegData}} items
<clr-dg-pagination #pagination [clrDgTotalItems]="totalRegData" [clrDgPageSize]="currentPageSize"></clr-dg-pagination>
</clr-dg-footer>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)