reseting collection offset

This commit is contained in:
Yuri Kuznetsov
2024-03-18 13:54:28 +02:00
parent 21dab40b43
commit 570f886a1f
4 changed files with 15 additions and 1 deletions
+2
View File
@@ -455,6 +455,8 @@ class EmailListView extends ListView {
Espo.Ui.notify(' ... ');
this.collection.offset = 0;
xhr = this.collection
.fetch()
.then(() => Espo.Ui.notify(false));
+8 -1
View File
@@ -70,6 +70,8 @@ class ListWithCategories extends ListView {
setup() {
super.setup();
this.defaultMaxSize = this.collection.maxSize;
if (!this.categoryScope) {
this.categoryScope = this.scope + 'Category';
}
@@ -327,6 +329,8 @@ class ListWithCategories extends ListView {
this.nestedCategoriesCollection.reset();
this.collection.reset();
this.collection.offset = 0;
this.collection.maxSize = this.defaultMaxSize;
this.$listContainer.empty();
@@ -530,8 +534,11 @@ class ListWithCategories extends ListView {
this.currentCategoryName = model.get('name');
}
this.applyCategoryToCollection();
this.collection.offset = 0;
this.collection.maxSize = this.defaultMaxSize;
this.collection.reset();
this.applyCategoryToCollection();
this.collection.abortLastFetch();
Espo.Ui.notify(' ... ');
+3
View File
@@ -731,6 +731,7 @@ class ListRecordView extends View {
}
resetCustomOrder() {
this.collection.offset = 0;
this.collection.resetOrderToDefault();
this.collection.trigger('order-changed');
@@ -765,6 +766,8 @@ class ListRecordView extends View {
this.collection.pop();
}
this.collection.offset = 0;
this.collection
.sort(orderBy, order)
.then(() => {
+2
View File
@@ -322,6 +322,8 @@ class SearchView extends View {
}
}
this.collection.offset = 0;
if (toTriggerEvent) {
this.trigger('change-view-mode', mode);
}