primeng

How to use template in <p-datatable>

拈花ヽ惹草 提交于 2019-12-03 13:04:14
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" selectionMode="single" sortField="Status" [sortOrder]="-1"> <p-column field="FileName" header="Naam"

how to initialize primeng tree component

人走茶凉 提交于 2019-12-03 04:05:16
Given a tree how to initialize it in such way that the nodes are expanded at will? I already tried to get a reference with @ViewChildren(Tree) tree but is resulting in undefined references when trying to access his children This is a hack that basically simulates clicks along the tree. I add this solution but I really hope someone could find something better. Given a component with a tree we can get a reference to the treenodes and then "click" them as necessary: @Component({ selector: 'filemanager', templateUrl: './filemanager.html', directives: [Tree] }) export class FileManagerComponent

ng-template with *ngFor issue in angular 8

烂漫一生 提交于 2019-12-02 16:18:15
问题 I want to create a table with dynamically generated columns. I used PrimeNg library for the grid. I opened many questions,but no one replied me,please help me to do this. I used with *ngFor to generate table column headers There are 2 arays. one for the row data and one for columns names. Here is my row data array.which contains one row uersSurveyAnswers: any = [ { userEmail: 'amara@gmail.com', qustns: [ { qNo: 1, ansrs: ['1'] }, { qNo: 2, ansrs: ['1', '0', '1', '1'] }, { qNo: 5, ansrs: ['2']

How to Observable map nested json objects with different property names - Angular

拟墨画扇 提交于 2019-12-02 15:28:49
问题 I have an json result which has nested objects. I need to cast them to my custom objects ( prime ng tree table json) which have different property names than the json result. JSON meesage: { brinname: "Aamir", aantalPersonen: "122", signalenVestiging: [ { vestiging: "Ranchi", aantalPersonen: "102", signalenCode: [ { signaalCode: "4", aantalPersonen: "15" }, { signaalCode: "5", aantalPersonen: "15" } ] }, { vestiging: "Bangalore", aantalPersonen: "82", signalenCode: [ { signaalCode: "6",

Prerendering failed because of error: ReferenceError: Event is not defined with PrimeNG AutoComplete

做~自己de王妃 提交于 2019-12-02 05:43:04
问题 I am trying to use PrimgNG in my angular2 app (primeng 2.0.5, Angular 2.0.x). I can get the ButtonModule and InputTextModule work but not the AutoCompleteModule. I am getting this error as soon as I add AutoCompleteModule to the application. An unhandled exception occurred while processing the request. Exception: Call to Node module failed with error: Prerendering failed because of error: ReferenceError: Event is not defined app.component.html: <button pButton type="button" (click)="onclick()

Unit Testing Angular Observables

自作多情 提交于 2019-12-02 02:28:56
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 really want to delete this record?', accept: () => { observer.next(true); observer.complete(); }, reject:

where can I find documentation for specific version [closed]

可紊 提交于 2019-12-01 17:27:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I use primeng UI components 1.1.1 version for angular. But on their site (https://www.primefaces.org/primeng) I can find documentation only for the latest version. Where I can find documentation for specific older versions? I do not want to upgrade to the latest version as I can corrupt something in my project.

Extending a PrimeNg component inside Angular2

*爱你&永不变心* 提交于 2019-12-01 06:51:44
问题 Due to some use cases, I need to extend a PrimeNG component in Angular2. For proofing purpouses, I chose using the DataTable since it is complicated enough. After literally copy pasting the @Component annotation, I have added: export class PPDataTable extends DataTable {} At this point I get the following error: No provider for DataTable . If I add DataTable to the providers array in the annotation, the content of my DataTable is empty. Therefore I tried adding: { provide: DataTable, useValue

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

此生再无相见时 提交于 2019-12-01 04:18:26
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" (onLazyLoad)="getNewDatasource($event)" (onRowSelect)="onRowSelect($event)" > <p-column [style]="{'width':

Implement two-way data binding for custom property

久未见 提交于 2019-12-01 03:48:26
问题 I see in primeng components the use something like ngModel (two-way data binding) style for some property like this [(selection)]="selectedItem"; it 's look like @Input() selection; @Output() selection:EventEmitter<any> = new EventEmitter<any>(); how I can implement something like this and is it possible to do for more than single property like <component-a [(selection)]="selectedItem" [(data)]="selectedData"></component-a> 回答1: Angular docs <app-sizer [(size)]="fontSizePx"> </app-sizer> The