Issue with p-table pTemplate="frozenfooter" not displaying at all and frozenrow show bottom #6592
Labels
Status: Pending Review
Issue or pull request is being reviewed by Core Team
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Type: New Feature
Issue contains a new feature or new component request
Milestone
We are trying to achieve a frozen footer row within p-table. We’re working from the examples shown here - https://www.primefaces.org/primeng/#/table - under the “Scrolling” section, specifically in reference to “frozenfooter” as a pTemplate.
We did get a version of the pTemplate="frozenrow" working, by passing the data to the [frozenValue] property of the p-table. That worked, but visually it was stuck to the top of the table. What we’re trying to achieve is the same thing with the footer, stuck to the bottom.
However, pTemplate=“frozenfooter” doesn’t seem to work in the same way. In your examples, there is no data specifically being passed to the footer itself?
Here is the code from the component we recreated using your "Cars" data model from primefaces' examples.
tablescrolldemo.component.ts:
import { Component, OnInit } from '@angular/core';
import {Car} from '../domain/car';
import {CarService} from '../car.service';
@component({
selector: 'app-tablescrolldemo',
templateUrl: './tablescrolldemo.component.html',
styleUrls: ['./tablescrolldemo.component.css']
})
export class TablescrolldemoComponent implements OnInit {
cars1: Car[];
cars2: Car[];
cars3: Car[];
cars4: Car[];
cars5: Car[];
virtualCars: Car[];
totalRecords: number;
cols: any[];
frozenCars: Car[];
frozenCols: any[];
scrollableCols: any[];
sales: any[];
loading: boolean;
constructor(private carService: CarService) { }
ngOnInit() {
this.carService.getCarsMedium().then(cars => this.cars1 = cars);
this.carService.getCarsSmall().then(cars => this.cars2 = cars);
this.carService.getCarsMedium().then(cars => this.cars3 = cars);
this.carService.getCarsMedium().then(cars => this.cars4 = cars);
this.carService.getCarsMedium().then(cars => this.cars5 = cars);
}
}
tablescrolldemo.component.html:
Frozen Rows
{{col.header}}Brand {{sale.brand}} Sale Rate Sales Profits Last Year This Year Last Year This Year {{sale.lastYearSale}} {{sale.thisYearSale}} {{sale.lastYearProfit}} {{sale.thisYearProfit}} HI
EDIT: For some reason I can't get this code to format properly. I tried quoting it, but it's throwing it off.
The text was updated successfully, but these errors were encountered: