diff --git a/src/app/shared/object-grid/object-grid.component.html b/src/app/shared/object-grid/object-grid.component.html index b3ad9cc27c..0afd623d86 100644 --- a/src/app/shared/object-grid/object-grid.component.html +++ b/src/app/shared/object-grid/object-grid.component.html @@ -11,10 +11,10 @@ (sortDirectionChange)="onSortDirectionChange($event)" (sortFieldChange)="onSortFieldChange($event)" (paginationChange)="onPaginationChange($event)"> -
-
-
- +
+
+
+
diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index c4aaebed72..c6f8347217 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -172,18 +172,13 @@ export class ObjectGridComponent implements OnInit { const result = []; - let index = 0; page.forEach((obj: ListableObject, i: number) => { - - if (i % nbColumns === 0 && i > 0) { - index++; - } - - let col = result[index]; + const colNb = i % nbColumns; + let col = result[colNb]; if (hasNoValue(col)) { col = []; } - result[index] = [...col, obj]; + result[colNb] = [...col, obj]; }); return result; } else {