primeng

PrimeNG Turbotable expand by default

ε祈祈猫儿з 提交于 2019-12-23 06:50:54
问题 I have a PrimeNg turbotable with row expansion feature. How can I expand the rows by default. Here is my Code : HTML <p-table [columns]="cols" [value]="cars" dataKey="vin"> <ng-template pTemplate="header" let-columns> <tr> <th style="width: 2.25em"></th> <th *ngFor="let col of columns"> {{col.header}} </th> </tr> </ng-template> <ng-template pTemplate="body" let-rowData let-expanded="expanded" let-columns="columns"> <tr> <td> <a href="#" [pRowToggler]="rowData"> <i [ngClass]="expanded ? 'fa fa

p-table rowsPerPageOptions does not expand the dropdown

三世轮回 提交于 2019-12-23 06:05:11
问题 I'm using the p-table component trying to show the paginator with the dropdown with rows per page option (rowsPerPageOptions): <p-table [columns]="cols" [value]="myData" [paginator]="true" [rows]="2" [rowsPerPageOptions]="[1,2,3]"> The table shows up fine with the paginator control, but the dropdown that contains the per-page option does not expand (drop). Here's the stackblitz link of the app - https://stackblitz.com/edit/angular-xywt2w?file=app/provider-search/provider-search.component.html

p-table rowsPerPageOptions does not expand the dropdown

ⅰ亾dé卋堺 提交于 2019-12-23 06:04:12
问题 I'm using the p-table component trying to show the paginator with the dropdown with rows per page option (rowsPerPageOptions): <p-table [columns]="cols" [value]="myData" [paginator]="true" [rows]="2" [rowsPerPageOptions]="[1,2,3]"> The table shows up fine with the paginator control, but the dropdown that contains the per-page option does not expand (drop). Here's the stackblitz link of the app - https://stackblitz.com/edit/angular-xywt2w?file=app/provider-search/provider-search.component.html

Dynamic binding issue with angular and primeng

你离开我真会死。 提交于 2019-12-23 05:02:00
问题 The following code works fine. <p-column *ngFor="let col of detailsModel.columnDefs" [field]="col.field" [header]="col.headerName" [style]="{'width':'150px','text-align':'right'}" sortable="true"> </p-column> Now I want to make the style part dynamic. So, if I re-wrote my code like this <p-column *ngFor="let col of detailsModel.columnDefs" [field]="col.field" [header]="col.headerName" [style]="col.textAlign == 'left' ? alignLeft : alignRight" sortable="true"> </p-column> TS file: export class

Dynamic binding issue with angular and primeng

人走茶凉 提交于 2019-12-23 05:01:44
问题 The following code works fine. <p-column *ngFor="let col of detailsModel.columnDefs" [field]="col.field" [header]="col.headerName" [style]="{'width':'150px','text-align':'right'}" sortable="true"> </p-column> Now I want to make the style part dynamic. So, if I re-wrote my code like this <p-column *ngFor="let col of detailsModel.columnDefs" [field]="col.field" [header]="col.headerName" [style]="col.textAlign == 'left' ? alignLeft : alignRight" sortable="true"> </p-column> TS file: export class

How do you get Angular 2 (or 4) PrimeNg Charts to refresh asynchronously?

三世轮回 提交于 2019-12-23 04:35:33
问题 Problem: How to get PrimeNg Charts to refresh asynchronously? Scenario: I have a dropdown that I want to refresh the chart based on a user selection. I thought I knew the answer to this question after gaining an understanding of Angular change detection and how I would need to reassign an object for it to see the data had been changed (as opposed to updating the data within the object in place), but after reading about many other charts and even trying them, I learned that the problem was a

Extending components in PrimeNG

99封情书 提交于 2019-12-23 04:32:30
问题 I would like to extend a component in PrimeNg using Angular 2. I tried a simple example to extend the MultiSelect component and was unsuccessful. I am getting the below error "No provider for DomHandler!" in the browser console. Has anyone tried extending the PrimeNg components. Is it even possible. The exact exception:<> "EXCEPTION: Error in ./AppComponent class AppComponent - inline template:0:0 caused by: No provider for DomHandler! ErrorHandler.handleError @ error_handler.js:54

Angular PrimeNG dropdown component in reactive forms - initial value

守給你的承諾、 提交于 2019-12-23 01:57:12
问题 using primeNg dropdown component, I'm trying to initialized the dropdown with initial value with no success, I'm using reactive approach. I checked the primeNg documentation and demos - almost all the examples there are using template driven, I would like to have the same with model driven. I'm able to render the dropdown with the values in the list but the selected item is not the one I declared in the form, instead it's the first item in the list. my code: template <div [formGroup]=

date + time to timestamp in angular2

醉酒当歌 提交于 2019-12-22 08:17:45
问题 Am trying to learn angular2+ and i want to make a GoogleCalendar's like scheduler app. After many research, i decided to use PrimeNG. The output format of the calendar is 2016-01-16T16:00:00 that's seems great and complete. But the api i want to interract with uses timeStamp... I tried to make a Javascript function who's parsing my date format : function toTimestamp(strDate){ var datum = Date.parse(strDate); return datum/1000; } alert(toTimestamp('02/13/2009 23:31:30')); But my problem is

How to trigger PrimeNG Accordion Click programmatically in Angular 2.0?

三世轮回 提交于 2019-12-21 20:46:39
问题 I have an accordion as shown below. When the link is clicked, I'd need to trigger the click event of all p-accordianTab elements. How is it possible? <a (click)="openCloseAll()" >{{openCloseAllText}} all</a> <p-accordion [multiple]="true"> <div class="row" *ngFor="let category of result.Categories"> <p-accordionTab #accordianTab header="{{category.Name}}"> </p-accordionTab> </div> </p-accordion> I tried adding this "#accordionTab" to the element and accessing it from TypeScript but doesn't