exception when dropdown is in column

UI Components for Angular
Post Reply
yonatanl
Posts: 12
Joined: 04 May 2016, 10:58

04 May 2016, 11:36

this is the model that the data table rows show.

Code: Select all

import {User} from "./user"
export class Incident {
    
    constructor(public id : Number, 
                public name : String, 
                public host : String,
                public score : number,
                public timestamp : Date,
                public user : User,
                public comment : string,
                public highlights :string[]){
    }
};
the inner model looks like this:

Code: Select all

export class User
{
    constructor (public id: number, public name : string){}
}
and the html looks like:

Code: Select all

<p-dataTable [value]="incidents" selectionMode="single" [(selection)]="selectedIncident" (onRowSelect)="onRowSelect($event)" [paginator]="true" [rows]="10" [responsive]="true">
        <p-column [sortable]="true" field="" header="Status"></p-column>
        <p-column [sortable]="true" field="score" header="Score"></p-column>
        <p-column [sortable]="true" field="" header="Behavior Tags"></p-column>
        <p-column [sortable]="true" field="host" header="Host"></p-column>
        <p-column [sortable]="true" field="timestamp" header="Timestamp"></p-column>
        <p-column [sortable]="true" field="id" header="Trace Id"></p-column>
        <p-column [sortable]="true" field="user" header="Assigned">
                <template let-col let-ins="rowData">
                <p-dropdown [options]="users" [(ngModel)]="ins[col.field]"></p-dropdown>
            </template>
        </p-column>
        <p-column [sortable]="true" field="" header="Grouped"></p-column>
        <p-column [sortable]="true" field="comment" header="Comments"></p-column>
    </p-dataTable>
I get this exception:
angular2.dev.js:25644 ORIGINAL EXCEPTION: No value accessor for ''

thx!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

05 May 2016, 15:23

Does it work when outside of column? What is your PrimeNG version?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests