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

374
Views
Por qué PrimeNG p-table Reorder no funciona en el módulo importado

Cuando uso este código de la documentación, funciona en el módulo raíz, pero quiero hacer lo mismo en el módulo con carga diferida. Cuando intento reordenar la tabla en un módulo con carga diferida, se congela. Revisé la importación y todo está bien, así que si alguien tuvo el mismo problema, por favor ayuda :).

HTML

 <p-table [value]="products" [columns]="cols" [reorderableColumns]="true" responsiveLayout="scroll"> <ng-template pTemplate="header" let-columns> <tr> <th style="width:3rem"></th> <th *ngFor="let col of columns" pReorderableColumn> {{col.header}} </th> </tr> </ng-template> <ng-template pTemplate="body" let-rowData let-columns="columns" let-index="rowIndex"> <tr [pReorderableRow]="index"> <td> <span class="pi pi-bars" pReorderableRowHandle></span> </td> <td *ngFor="let col of columns"> {{rowData[col.field]}} </td> </tr> </ng-template> </p-table>

TS:

 import { Component, OnInit } from '@angular/core'; import { Product } from '../../domain/product'; import { ProductService } from '../../service/productservice'; @Component({ templateUrl: './tablereorderdemo.html' }) export class TableReorderDemo implements OnInit { products: Product[]; cols: any[]; constructor(private productService: ProductService) { } ngOnInit() { this.productService.getProductsSmall().then(data => this.products = data); this.cols = [ { field: 'code', header: 'Code' }, { field: 'name', header: 'Name' }, { field: 'category', header: 'Category' }, { field: 'quantity', header: 'Quantity' } ]; } }

https://www.primefaces.org/primeng/showcase/#/table/reorder

about 4 years ago · Juan Pablo Isaza
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!