primeng

PrimeNG DataTable server-side paging

强颜欢笑 提交于 2019-12-21 19:51:30
问题 I'm currently working on an Angular 4 project and using the PrimeNG DataTable. So far this framework seems pretty neat, but I would like to make my paging server-side. That way I will load only 10,20,.. records at a time rather than loading all 1000+ at once.. Has anyone done this before or does anyone know a solution for this? PS: If you don't have a solution but know a framework that does support this, please let me know! 回答1: Looks like Lazy is what we are... looking for :) https://www

Angular2 + PrimeNG - How to reset dataTable when the underlying data changes?

江枫思渺然 提交于 2019-12-21 04:58:14
问题 I'm binding an array of Cell objects to a PrimeNG DataTable: .html: <p-dataTable [value]="_cells" [responsive]="true" [globalFilter]="gb"> <p-column field="id" header="id" sortable="true"></p-column> <p-column field="name" header="name" sortable="true" ></p-column> </p-dataTable> .ts: ngOnInit() { var self = this; // Capture the id in the URL this._route.params.subscribe(params => { self._stationId= params['id']; this._dataService .GetAllCells(self._stationId) .subscribe((data:Cell[]) => this

How to use template in <p-datatable>

狂风中的少年 提交于 2019-12-21 04:19:20
问题 I've got a very basic question which I can't answer myself because most links to http://www.primefaces.org/primeng don't work anymore. I also tried registering to their forum but their activation mail never arrives. I use Angular2 and have a datatable with two columns: filename and status. The status column I want to change. It holds now a number from 1 to 4 and I want to show a glyphicon based on the status. I now have this, which is working: <p-dataTable [hidden]="loading" [value]="files"

Unit Testing Angular Observables

自作多情 提交于 2019-12-20 03:15:14
问题 I am new to testing world and I have just started writing unit tests for an existing Angular 2 code. I have a function confirmDelete which returns Obserable<boolean> and internally uses ConfirmationService of PrimeNG to get user's feedback on a popup. Definition of the function is given below: confirmDelete(): Observable<boolean> { let confirmObservable = Observable.create((observer: Observer<boolean>) => { this.confirmationService.confirm({ header: 'Delete Confirmation', message: 'Do you

How to programmatically trigger refresh primeNG datatable when a button is clicked

两盒软妹~` 提交于 2019-12-19 06:18:24
问题 I have a refresh button that is outside the primeNG datatable. How do I programmatically trigger to refresh the datatable? something like this: <div class="pull-right"> <button id="FilterBtnId" (click)="???"> </button> </div> <p-dataTable #datatable [value]="datasource" [(selection)]="jobs" [totalRecords]="totalRecords" selectionMode="multiple" resizableColumns="true" [pageLinks]="10" [rows]="10" [rowsPerPageOptions]="[10, 25, 50, 100]" [paginator]="true" [responsive]="true" [lazy]="true"

How to programmatically trigger refresh primeNG datatable when a button is clicked

不羁岁月 提交于 2019-12-19 06:17:59
问题 I have a refresh button that is outside the primeNG datatable. How do I programmatically trigger to refresh the datatable? something like this: <div class="pull-right"> <button id="FilterBtnId" (click)="???"> </button> </div> <p-dataTable #datatable [value]="datasource" [(selection)]="jobs" [totalRecords]="totalRecords" selectionMode="multiple" resizableColumns="true" [pageLinks]="10" [rows]="10" [rowsPerPageOptions]="[10, 25, 50, 100]" [paginator]="true" [responsive]="true" [lazy]="true"

Type object is not assignable to type any[]

元气小坏坏 提交于 2019-12-18 09:48:31
问题 I am using PrimeNG datatable. I using httpClient in Angular to fetch some mock data from JSON Placeholder. It appears in my console as an array of objects, however the Visual Studio Code error is saying it is an object. The error says 'type Object is not assignable to any[].' What is the problem here? table-layout.component.ts import { BrowserModule } from '@angular/platform-browser' import { Component, OnInit, NgModule } from '@angular/core'; import { HttpClient } from '@angular/common/http'

Steps to integrate PrimeNG with JHipster

£可爱£侵袭症+ 提交于 2019-12-17 18:57:18
问题 We have been trying to incorporate PrimeNG components into a JHipster (angular 4) generated project with no success. After download and install PrimeNG into our project, we are able to import classes but when we include the corresponding tags into templates nothing is drawn. We have tested several of the PrimeNG components. Also we have done the imports in app.module, etc. I would like to be more concrete, but no error is displayed anywhere. Do you have any hint on how work with PrimeNG and

What is Best way to override the style of primeng components?

蓝咒 提交于 2019-12-17 18:09:19
问题 i want to overright the style of primeng components as per component level not for whole app, either i have to change the style in main theme.css file or inline style, but seems inline not works sometimes as expected let suppose as example i have to use <p-dropdown [options]="cities" formControlName="selectedCity"></p-dropdown> and i have to change the style of class ui-dropdown-item class name as per documentation. i need same component with two diff style what is the best approcah for the

What is Best way to override the style of primeng components?

戏子无情 提交于 2019-12-17 18:08:44
问题 i want to overright the style of primeng components as per component level not for whole app, either i have to change the style in main theme.css file or inline style, but seems inline not works sometimes as expected let suppose as example i have to use <p-dropdown [options]="cities" formControlName="selectedCity"></p-dropdown> and i have to change the style of class ui-dropdown-item class name as per documentation. i need same component with two diff style what is the best approcah for the