From a2275d2796331ff824f0f3ce05b9c2f92ad728c8 Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Tue, 12 Apr 2022 21:12:10 +0200 Subject: Ispravio datatable komponentu koja se nije ucitavala za postojeci dataset. Dodao broj redova u klasu dataset posto vise nije isti kao broj elemenata podataka koje prikazujemo. --- .../_elements/datatable/datatable.component.html | 70 ++++++++++++---------- .../app/_elements/datatable/datatable.component.ts | 18 ++++-- 2 files changed, 49 insertions(+), 39 deletions(-) (limited to 'frontend/src/app/_elements/datatable') diff --git a/frontend/src/app/_elements/datatable/datatable.component.html b/frontend/src/app/_elements/datatable/datatable.component.html index b6cbd303..8db62aff 100644 --- a/frontend/src/app/_elements/datatable/datatable.component.html +++ b/frontend/src/app/_elements/datatable/datatable.component.html @@ -1,39 +1,43 @@ -PRE IFA -{{hasInput}} -
- PROSLO IF -
-
+
+
-
- - - - - - - - - - - -
{{item}}
{{col}}
- - - - - - - -
{{col}}
+
+
+
+ Tabela {{tableData.numCols}}x{{tableData.numRows}} +
+
+
+ + + + + + + + + + + + + + +
{{item}}
{{col}}
+ {{tableData.numRows - 11}} redova...
+ + + + + + + + + +
{{col}}
+ {{tableData.numRows - 10}} redova...
+
- -
-
- {{data.length - 1}} x {{data[0].length}} - {{data.length}} x {{data[0].length}} -
\ No newline at end of file diff --git a/frontend/src/app/_elements/datatable/datatable.component.ts b/frontend/src/app/_elements/datatable/datatable.component.ts index 19fb204e..82374f4d 100644 --- a/frontend/src/app/_elements/datatable/datatable.component.ts +++ b/frontend/src/app/_elements/datatable/datatable.component.ts @@ -7,12 +7,7 @@ import { Component, Input, OnInit } from '@angular/core'; }) export class DatatableComponent implements OnInit { - @Input() hasHeader?: boolean = true; - - @Input() data?: any[] = []; - - hasInput = false; - loaded = false; + @Input() tableData!: TableData; constructor() { } @@ -20,3 +15,14 @@ export class DatatableComponent implements OnInit { } } + +export class TableData { + constructor( + public hasHeader = true, + public hasInput = false, + public loaded = false, + public numRows = 0, + public numCols = 0, + public data?: any[][] + ) { } +} -- cgit v1.2.3