-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix datalist reload and infinite loading
- Loading branch information
1 parent
df1ca76
commit 8c9b3e4
Showing
7 changed files
with
1,101 additions
and
1,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
<sio-page [title]="'Task ('+this.taskState.localTotals+'/'+this.taskState.remoteTotals+') index' + this.taskState.remoteIndex"> | ||
<sio-datalist [store]="this.taskState" | ||
header="name" | ||
label="description" | ||
thumbnail="thumbnail" | ||
enableLeftSwipe | ||
[enableInfinite]="this.taskState.localTotals < this.taskState.remoteTotals" | ||
(leftSwipe)="this.archive($event)" | ||
(rightSwipe)="this.delete($event)" | ||
(infinite)="this.load($event)" | ||
(refresh)="this.refresh($event)" | ||
></sio-datalist> | ||
<sio-page | ||
[title]="'Task ('+this.taskState.localTotals+'/'+this.taskState.remoteTotals+') index' + this.taskState.remoteIndex"> | ||
<sio-datalist [store]="this.taskState" header="name" label="description" thumbnail="thumbnail" | ||
[enableInfinite]="this.taskState.localTotals < this.taskState.remoteTotals" (sioOnLeftSwipe)="this.archive($event)" | ||
(sioOnRightSwipe)="this.delete($event)" (sioOnInfinite)="this.load($event)" (sioOnRefresh)="this.refresh($event)"> | ||
<ion-item-option slot="right_options">Favorite</ion-item-option> | ||
<ion-item-option slot="right_options" color="danger">Delete</ion-item-option> | ||
</sio-datalist> | ||
<ion-fab slot="footer" vertical="bottom" horizontal="end"> | ||
<sio-button | ||
(Click)="this.create()" | ||
type="fab" | ||
icon="add" | ||
color="danger" | ||
></sio-button> | ||
<sio-button (Click)="this.create()" type="fab" icon="add" color="danger"></sio-button> | ||
</ion-fab> | ||
</sio-page> | ||
</sio-page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
<ion-refresher slot="fixed" (ionRefresh)="this.refresh($event)"> | ||
<ion-refresher-content pullingIcon="chevron-down-circle-outline" pullingText="{{ 'LIST_PULL_TEXT' | translate }}" | ||
refreshingSpinner="circles" refreshingText="{{ 'LIST_PULL_WAITING' | translate }}" > | ||
</ion-refresher-content> | ||
</ion-refresher> | ||
<ion-list> | ||
<sio-item *ngFor="let item of this.data; trackItem" [$id]="item['$id']" [header]="item[this.header]" | ||
[label]="item[this.label]" [thumbnail]="this.thumbnail ? item[this.thumbnail] : undefined" | ||
[avatar]="this.avatar ? item[this.avatar] : undefined" [icon]="this.icon ? item[this.icon] : undefined" | ||
(sioOnLeftSwipe)="this.leftSwipe($event)" | ||
(sioOnRightSwipe)="this.rightSwipe($event)"></sio-item> | ||
</ion-list> | ||
<ion-infinite-scroll *ngIf="this.enableInfinite" threshold="20%" (ionInfinite)="this.infinite($event)"> | ||
<ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="{{ 'LIST_LOADING' | translate }}"> | ||
</ion-infinite-scroll-content> | ||
</ion-infinite-scroll> | ||
(sioOnLeftSwipe)="this.leftSwipe($event)" (sioOnRightSwipe)="this.rightSwipe($event)"> | ||
<div slot="right_options"> | ||
<div #right_options> | ||
<ng-content select="[slot='right_options']"></ng-content> | ||
</div> | ||
</div> | ||
</sio-item> | ||
</ion-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 22 additions & 12 deletions
34
libs/database/src/lib/components/data-list/data-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
<sio-list | ||
[data]="this.store!.selectAll()" | ||
[header]="this.header" | ||
[label]="this.label" | ||
[thumbnail]="this.thumbnail" | ||
[enableLeftSwipe]="this.enableLeftSwipe" | ||
[enableInfinite]="this.enableInfinite" | ||
(sioOnLeftSwipe)="this.onLeftSwipe($event)" | ||
(sioOnRightSwipe)="this.onRightSwipe($event)" | ||
(sioOnInfinite)="this.onInfinite($event)" | ||
(sioOnRefresh)="this.onRefresh($event)" | ||
></sio-list> | ||
<ion-refresher slot="fixed" *ngIf="this.refresh !== null" (ionRefresh)="this.refresh($event)"> | ||
<ion-refresher-content pullingIcon="chevron-down-circle-outline" pullingText="{{ 'LIST_PULL_TEXT' | translate }}" | ||
refreshingSpinner="circles" refreshingText="{{ 'LIST_PULL_WAITING' | translate }}"> | ||
</ion-refresher-content> | ||
</ion-refresher> | ||
<sio-list [data]="this.store!.selectAll()" [header]="this.header" [label]="this.label" [thumbnail]="this.thumbnail" | ||
(sioOnLeftSwipe)="this.leftSwipe($event)" (sioOnRightSwipe)="this.rightSwipe($event)" | ||
(sioOnInfinite)="this.infinite($event)" (sioOnRefresh)="this.refresh($event)"> | ||
<ion-item-option slot="left_options">Favorite</ion-item-option> | ||
<ion-item-option slot="left_options" color="danger">Delete</ion-item-option> | ||
<div #left_options> | ||
<ng-content select="[slot='left_options']"></ng-content> | ||
</div> | ||
<div #right_options> | ||
<ng-content select="[slot='right_options']"></ng-content> | ||
</div> | ||
</sio-list> | ||
<ion-infinite-scroll *ngIf="this.infinite !== null && this.store?.localTotals !== this.store?.remoteTotals" | ||
threshold="20%" (ionInfinite)="this.infinite($event)"> | ||
<ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="{{ 'LIST_LOADING' | translate }}"> | ||
</ion-infinite-scroll-content> | ||
</ion-infinite-scroll> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.