DataTable: bind Calendar in column template

UI Components for Angular
Post Reply
kemmis
Posts: 1
Joined: 13 Oct 2016, 22:03

14 Oct 2016, 15:36

Is it possible to bind a Calendar control inside a DataTable column template? When I try to set the [(ngModel)] of the p-calendar inside a column template I get the "Can't bind to 'ngModel' since it isn't a known property of 'p-calendar'" error. When I leave out the [(ngModel)] attribute in my markup, then the calendar control renders without errors, but then its value isn't bound to anything I can use.

Here's my markup. Any help is appreciated!

Code: Select all

        <p-dataTable [value]="files">           
            <p-column header="File Name" field="fileName"></p-column>           
            <p-column header="Deposit Date" field="depositDate">
                <template let-col let-file="rowData" pTemplate type="body">
                    <p-calendar [(ngModel)]="file.depositDate"></p-calendar>
                </template>
            </p-column>
        </p-dataTable>
In this context, files is an array of objects that each have fileName and depositDate string properties.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests