fix record prev/next if no total

This commit is contained in:
Yuri Kuznetsov
2024-02-15 09:13:07 +02:00
parent bc58ca647d
commit 8cd6912fee
+6 -3
View File
@@ -1758,14 +1758,17 @@ class DetailRecordView extends BaseRecordView {
previousButtonEnabled = true;
}
if (this.indexOfRecord < this.model.collection.total - 1) {
const total = this.model.collection.total !== undefined ?
this.model.collection.total : this.model.collection.length;
if (this.indexOfRecord < total - 1) {
nextButtonEnabled = true;
}
else {
if (this.model.collection.total === -1) {
if (total === -1) {
nextButtonEnabled = true;
}
else if (this.model.collection.total === -2) {
else if (total === -2) {
if (this.indexOfRecord < this.model.collection.length - 1) {
nextButtonEnabled = true;
}