Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
cómo hacer que cdk virtual scroll represente elementos de la tabla

Estoy usando CDK VIRTUAL SCROLL en una tabla que carga un servicio (API) que me devuelve una lista, con esta lista puedo quitar o devolver sus columnas respectivamente así como sus elementos, pero cuando elimino todas las columnas de la tabla y solicitó regresar, ¡solo las columnas terminaron regresando normalmente pero sus artículos no!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

puedes tener algo como

 <table> <cdk-virtual-scroll-viewport #scroller itemSize="6" class="content"> <ng-container *cdkVirtualFor="let item of items; let i = index"> <thead *ngIf="!i"> <tr> <td>Prop1</td> <td>Prop2</td> </tr> </thead> <tr> <td style="min-width:10rem"> {{ item.prop1 }} </td> <td style="min-width:10rem">{{ item.prop1 }}</td> </tr> </ng-container> </cdk-virtual-scroll-viewport> </table>

Con un cdkscroll "típico"

 ngOnInit() { this.fetchMore(); this.scroller.elementScrolled().pipe( map(() => this.scroller.measureScrollOffset('bottom')), pairwise(), filter(([y1, y2]) => (y2 < y1 && y2 < 140)), throttleTime(200) ).subscribe(() => { this.ngZone.run(() => { this.fetchMore(); }) } ); } fetchMore(): void { const newItems="......." this.items=[...this.items,...newItems] }

ver un pequeño stackblitz

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!