primeng

PrimeNG table: how to start a cell edit?

我怕爱的太早我们不能终老 提交于 2020-12-13 11:29:18
问题 I've got a PrimeNG p-table with a number of columns and rows, one column uses an input as its cell editor. Compact version below: <p-table [value]="rowDatas" selectionMode="single" [(selection)]="selectedRowData"> <ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex"> <tr [pSelectableRow]="rowData"> <td pEditableColumn> <p-cellEditor> <ng-template pTemplate="input"> <input id="{{'hours' + rowIndex}}" pInputText type="text" [(ngModel)]="rowData.hours"> </ng-template> <ng-template

PrimeNG table: how to start a cell edit?

早过忘川 提交于 2020-12-13 11:29:08
问题 I've got a PrimeNG p-table with a number of columns and rows, one column uses an input as its cell editor. Compact version below: <p-table [value]="rowDatas" selectionMode="single" [(selection)]="selectedRowData"> <ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex"> <tr [pSelectableRow]="rowData"> <td pEditableColumn> <p-cellEditor> <ng-template pTemplate="input"> <input id="{{'hours' + rowIndex}}" pInputText type="text" [(ngModel)]="rowData.hours"> </ng-template> <ng-template

PrimeNG Panelmenu active state for menu items and submenu items?

你。 提交于 2020-12-13 04:41:25
问题 I am using Angular 7 and PrimeNg version "7.1.0-rc.1". Currently I am trying to integrate PanelMenu component but unable to set styles for active tab as routerLinkActive is not available. Is there any other way I can achieve the same. Thanks 回答1: First: you can make sub-menu items active by adding routerLinkActiveOptions: { exact: true } to the child items objects, that would make them active whenever you click on one of them or even the route changed: items: [ { label: 'View Branches', icon:

PrimeNG Panelmenu active state for menu items and submenu items?

感情迁移 提交于 2020-12-13 04:41:22
问题 I am using Angular 7 and PrimeNg version "7.1.0-rc.1". Currently I am trying to integrate PanelMenu component but unable to set styles for active tab as routerLinkActive is not available. Is there any other way I can achieve the same. Thanks 回答1: First: you can make sub-menu items active by adding routerLinkActiveOptions: { exact: true } to the child items objects, that would make them active whenever you click on one of them or even the route changed: items: [ { label: 'View Branches', icon:

primeng: Setting focus on control

不羁岁月 提交于 2020-12-12 12:22:10
问题 sorry for the noob question... what's the recommended way of setting the focus on a control when using the primeng pack? When using a traditional input control, I set up a form variable (#variable) and use the @ViewChild to get a reference to it so that I can access its native element: this._variable.nativeElement.focus(); How can I do the same when using one of primeng's controls? Thanks. Luis 回答1: I use the autofocus keyword: <input type="text" size="15" pInputText class="form-control"

primeNG p-multiSelect with reactive form setting value dynamically

情到浓时终转凉″ 提交于 2020-08-27 21:42:28
问题 I am trying to do simple thing dynamically set a value to p-multiSelect with a reactive form. Using the ngModel with p-multiSelect property works nice but if I use the reactive form with the p-multiSelect property i can't set p-multiSelect from component. According angular doc: "Support for using the ngModel input property and ngModelChange event with reactive form directives has been deprecated in Angular v6 and will be removed " https://angular.io/api/forms/FormControlName#use-with-ngmodel

GlobalFilter items from PrimeNG datatable change rowIndex too

£可爱£侵袭症+ 提交于 2020-07-10 10:26:49
问题 Overflow Community, I want some help on Angular PrimeNG data-table. Currently what is happening is row-index is assigned against each row and works fine but when I apply search filter on row-index got updated again from 0. What I want is to attain the row number against each row even after I search. You can see in the attached Screenshots for a better understanding. Pre-sales data has index 5 and after search it is updated to 0. All I want is to not update the index after search. 来源: https:/