reseting collection offset
This commit is contained in:
@@ -455,6 +455,8 @@ class EmailListView extends ListView {
|
||||
|
||||
Espo.Ui.notify(' ... ');
|
||||
|
||||
this.collection.offset = 0;
|
||||
|
||||
xhr = this.collection
|
||||
.fetch()
|
||||
.then(() => Espo.Ui.notify(false));
|
||||
|
||||
@@ -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(' ... ');
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -322,6 +322,8 @@ class SearchView extends View {
|
||||
}
|
||||
}
|
||||
|
||||
this.collection.offset = 0;
|
||||
|
||||
if (toTriggerEvent) {
|
||||
this.trigger('change-view-mode', mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user