primeng

access local variable within *ngIf

こ雲淡風輕ζ 提交于 2019-12-07 21:46:54
问题 I have a primeng (angular 2) dialog with a dropdown. I want to set focus to the dropdown when the dialog shows. The problem appears to be that my div is rendered conditionally. My code: <p-dialog (onShow)="fe.applyFocus()"> <div *ngIf="selectedItem"> <button pButton type="button" (click)="fe.applyFocus()" label="Focus"></button> <p-dropdown #fe id="reason" [options]="reasonSelects" [(ngModel)]="selectedReason" ></p-dropdown> </div> </p-dialog> In this code the button works fine, but the

Angular - Can a child component reference a parent's template variable?

痞子三分冷 提交于 2019-12-07 18:40:10
问题 I am working on an angular 4 application using a primefaces primeng component, p-contextmenu . I am trying to tell a child element to use a template variable of a parent component. app.html: <div> <router-outlet></router-outlet> <div #contextMenuHolder></div> </div> mycomponent.html: <p-contextMenu [appendTo]="contextMenuHolder" [model]="items"></p-contextMenu> Obviously it fails as the contextMenuHolder does not exist in the child, but in its parent: Angular: Identifier 'contextMenuHolder'

PrimeNG <p-table> and <p-calendar> icon's not showing after Refresh in Internate Explorer (IE7,11)

一曲冷凌霜 提交于 2019-12-07 13:42:04
问题 PrimeNG and icon's not showing after Refresh in Internate Explorer (IE7,11) almost all IE Browser Versions. But in local it is working fine while I am using same IE. But in Production environment I am getting this error as you can seen in given below image : Image Might not show as some restriction but the icon in Table like before refers << < 1 2 3 4 5 > >> after refresh 1 2 3 4 5 same thing happens with PrimeNG there icone is gone too 回答1: i have got some Solution which is working fine as

PrimeNG DataTable Custom Sorting or filtering (Angular 2)

≡放荡痞女 提交于 2019-12-07 07:41:59
问题 I am facing issue in sorting/Filtering date column in PrimeNg Datatable.As i am displaying date "dd/mm/yyyy" string . if is use template to display "dd/mm/yyyy" then filter is not working as filter working on actual data bind which is in date ISO format. if convert data to string format from the back end then sort is not correct as it sort on string instead of date. 回答1: I solved this issue using moment.js, because it's easier and faster, but always code can be customized a little bit if You

PrimeNG stylesheets not found

荒凉一梦 提交于 2019-12-07 07:13:33
问题 I'm having trouble with a new project I've just created. For some reason when trying to import the stylesheets of PrimeNG I'm getting a 404 error. I don't know if it's something to do with the configuration of my project. I'm using the Angular Class WebPack Starter, I've added PrimeNG but as mentioned above I'm getting a 404 error. Although it doesn't make much sense I'm suspecting that it's related to the fact that the stylesheets are in the node_modules folder. As a test I've put a .css

Show Context Menu after condition Check in Primeng Angular 4

你。 提交于 2019-12-07 05:44:28
I have to show a context menu in a primeng tree table only in the second level. Is there any way to show the context menu only after some condition check in typescript (angular 4)? you can bind onContextMenuSelect event and play with [hide], I have done it like this.. in html... <p-contextMenu #cm [model]="items" [hidden]="contextMenu"></p-contextMenu> and in ts .. viewDetails(selectedNode) { this.contextMenu = false; if (selectedNode.children.length == 0) { this.contextMenu = false; } else { this.contextMenu = true;} } hope it works.. For me, the best option was to use

PrimeNG: Differnce between p-Table and p-dataTable

半城伤御伤魂 提交于 2019-12-07 05:39:45
问题 https://www.primefaces.org/primeng/#/table As per the above link in the latest version of PrimeNG p-dataTable is deprecated. I have implemented my tables using version 5.2.7. Does it mean I have changed all the implementation? I have made for p-dataTable to p-table to use all new feature available for the table? What is the best way to upgrade my table implementation? And if I don't do that then will the latest version of PrimeNG will support for p-dataTable ? 回答1: p-table which is also known

Primeng - how to use styleClass?

为君一笑 提交于 2019-12-06 17:17:56
问题 I want to use the styleClass property of the Togglebutton component. As described in another post, I thought it is straight forward by using: styleClass="test" In my css-file I then set some attributes, like .test { background: red; } But this does not work. Working with style is perfectly clear by using [style]="{'background':'red'}" No problem with that. But styleClass does not work. Here is the component. Any idea how to use styleClass ? 回答1: To make things clear: the styleClass property

Angular PrimeNG dropdown component in reactive forms - initial value

£可爱£侵袭症+ 提交于 2019-12-06 15:44:43
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]="formGroup"> <p-dropdown [options]="results" formControlName="second" (onChange)="onChangeHandler($event)"

How to preset (programmatically) the filter value in primeng datatable

懵懂的女人 提交于 2019-12-06 12:05:28
问题 Using angular (4.1.3) and primeng (4.0.3) datatable I need to set the filter value (e.g. from URL parameter). There is a pretty good docu on custom filters by primeng (https://www.primefaces.org/primeng/#/datatable/filter). I've tried to implement it similarly with a primeng InputText component as a custom filter: <p-dataTable [value]="licenses" scrollable="true" exportFilename="licenses" sscrollHeight="60vh" [paginator]="true" [rows]="20" [pageLinks]="10" [rowsPerPageOptions]="[5,10,20,50