Category : primeng-datatable

I’m trying to reproduce the same example that exist on PrimeNG from their showcase https://www.primefaces.org/primeng/showcase/#/table/basic https://primeng-tablebasic-demo.stackblitz.io/ As resume we’ve a product.service.ts with the following method getProductsSmall() { return this.http.get<any>(‘assets/products-small.json’) .toPromise() .then(res => <Product[]>res.data) .then(data => { return data; }); } the app.component.ts export class AppComponent { products: Product[]; constructor(private productService: ProductService) { } ngOnInit() { ..

Read more

I need split page vertically (e.g. 60%:40%) to the two areas and splitter must be draggable. So I chose PrimeNG p-splitter. Right area contains p-table with horizontal scrollbar (based on doc: https://www.primefaces.org/primeng/showcase/#/table/scroll part: "Horizontal and Vertical"): <p-splitter [panelSizes]="[60,40]" [style]="{‘height’: ‘400px’}"> <ng-template pTemplate> <p-table [value]="cars" [scrollable]="true" [style]="{width:’600px’}" scrollHeight="200px"> … </p-table> </ng-template> <ng-template pTemplate> Panel 2 </ng-template> ..

Read more

how to show or hide edit button based when column srcSysName value = "ANO" in p-table Here is the code <ng-template pTemplate="body" let-ACC_LIST let-editing="editing" let-ri="rowIndex"> <tr [pEditableRow]="ACC_LIST"> <td> {{ACC_LIST.accntNum}} </td> <td> <p-cellEditor> <ng-template pTemplate="input"> <input pInputText type="text" [(ngModel)]="ACC_LIST.shortName"> </ng-template> <ng-template pTemplate="output"> {{ACC_LIST.shortName}} </ng-template> </p-cellEditor> </td> <td>{{ACC_LIST.srcSysName}}</td> <td style="text-align:center"> <button *ngIf="!editing" pButton pRipple type="button" pInitEditableRow icon="pi ..

Read more