diff options
Diffstat (limited to 'frontend/src/app')
-rw-r--r-- | frontend/src/app/_elements/form-dataset/form-dataset.component.html | 7 | ||||
-rw-r--r-- | frontend/src/app/_elements/form-dataset/form-dataset.component.ts | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/frontend/src/app/_elements/form-dataset/form-dataset.component.html b/frontend/src/app/_elements/form-dataset/form-dataset.component.html index 7e836192..bce8f857 100644 --- a/frontend/src/app/_elements/form-dataset/form-dataset.component.html +++ b/frontend/src/app/_elements/form-dataset/form-dataset.component.html @@ -47,9 +47,10 @@ <input class="file" id="file-upload" (change)="changeListener($event)" #fileInput type="file" accept=".csv"> <div class="mt-5 datatable"> - <button mat-button [ngClass]="{'hidden': !tableData.hasInput}" (click)="test()"><mat-icon>keyboard_arrow_left</mat-icon></button> - <button mat-button [ngClass]="{'hidden': !tableData.hasInput}" (click)="test()"><mat-icon>keyboard_arrow_right</mat-icon></button> - + <div class=""> + <button mat-button [ngClass]="{'hidden': !tableData.hasInput}" (click)="goBack()"><mat-icon>keyboard_arrow_left</mat-icon></button> + <button mat-button [ngClass]="{'hidden': !tableData.hasInput}" (click)="goForward()"><mat-icon>keyboard_arrow_right</mat-icon></button> + </div> <app-datatable [tableData]="tableData"></app-datatable> </div> diff --git a/frontend/src/app/_elements/form-dataset/form-dataset.component.ts b/frontend/src/app/_elements/form-dataset/form-dataset.component.ts index 11d7faed..fd3637f9 100644 --- a/frontend/src/app/_elements/form-dataset/form-dataset.component.ts +++ b/frontend/src/app/_elements/form-dataset/form-dataset.component.ts @@ -42,8 +42,17 @@ export class FormDatasetComponent { } //@ViewChild('fileImportInput', { static: false }) fileImportInput: any; cemu je ovo sluzilo? - test(){ - console.log("radi"); + goBack(){ + if(this.begin-10<=0) + this.begin=-1; + else + this.begin-=10; + this.loadExisting(); + + } + goForward(){ + this.begin+=10; + this.loadExisting(); } clear(){ this.tableData.hasInput = false; @@ -100,7 +109,7 @@ export class FormDatasetComponent { this.tableData.hasInput = true; this.tableData.loaded = false; - this.datasetsService.getDatasetFile(this.dataset.fileId).subscribe((file: string | undefined) => { + this.datasetsService.getDatasetFilePaging(this.dataset.fileId,this.begin,this.end).subscribe((file: string | undefined) => { if (file) { this.tableData.loaded = true; this.tableData.numRows = this.dataset.rowCount; |