Skip to content

Commit

Permalink
Merge pull request #13 from udistrital/feature/Ajustes_paginacion
Browse files Browse the repository at this point in the history
feat: Se realizan ajustes en las opciones para la paginacion y valores por defecto en las consultas.
  • Loading branch information
edwargl7 authored Sep 9, 2024
2 parents 2e078a8 + b686b2e commit 816dcf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<mat-form-field class="form" appearance="fill" [style.width.%]="100" [formGroup]="formUsuarios">
<mat-label class="label">Documento de identidad</mat-label>
<input class="input" matInput #documentoInput formControlName="documento" required>
<button mat-icon-button matSuffix (click)="IniciarPaginacion(); BuscarDocumento(documentoInput.value, 2, 0)">
<button mat-icon-button matSuffix (click)="IniciarPaginacion(); BuscarDocumento(documentoInput.value, opcionesPagina[0], 0)">
<mat-icon>search</mat-icon>
</button>
<mat-error *ngIf="formUsuarios.get('documento')?.hasError('required')">
Expand Down Expand Up @@ -146,7 +146,7 @@
<mat-footer-row *matFooterRowDef="displayedColumns"></mat-footer-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</table>
<mat-paginator [pageSizeOptions]="[2, 6]" [length]="total" showFirstLastButtons></mat-paginator>
<mat-paginator [pageSizeOptions]="opcionesPagina" [length]="total" showFirstLastButtons></mat-paginator>
</section>
</mat-card-content>
</mat-card>
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class UsuariosComponent implements OnInit {
dataSource = new MatTableDataSource<UserData>([]);
sistemaInformacion!: number;
total!: number;
opcionesPagina: number[] = [2, 4, 6];

roles: string[] = ['Administrador', 'Usuario Estándar'];

Expand All @@ -79,7 +80,7 @@ export class UsuariosComponent implements OnInit {
});

this.sistemaInformacion = environment.SISTEMA_INFORMACION_ID;
this.PeriodosUsuario(this.sistemaInformacion, 2, 0);
this.PeriodosUsuario(this.sistemaInformacion, this.opcionesPagina[0], 0);

// Inicializamos el filtro con funciones predicadas personalizadas
//this.dataSource.filterPredicate = this.customFilterPredicate();
Expand Down Expand Up @@ -108,6 +109,7 @@ export class UsuariosComponent implements OnInit {

IniciarPaginacion() {
this.paginator.pageIndex = 0;
this.paginator.pageSize = this.opcionesPagina[0];
}

PeriodosUsuario(sistema: number, limit: number, offset: number) {
Expand Down

0 comments on commit 816dcf0

Please sign in to comment.