Hello Prime,
I have started using your library for datatable.
Import {Column} from 'primeng/primeng' is missing from library. I have seen in the package it exists but under api/column.
when i try to generate data table like this, (without values for RowData)
<p-dataTable name="cars" >
<p-column field="vin" header="Vin"></p-column>
<p-column field="year" header="Year"></p-column>
<p-column field="brand" header="Brand"></p-column>
<p-column field="color" header="Color"></p-column>
</p-dataTable>
It failed and giving me execpetion for Hasfooter in DataTable.ts file. [Exeception : Cannot read property 'length' of undefined in [hasFooter() in DataTable@29:27]
Please suggest me what is wrong over here. I didn't get it work for simple layout.
Data table can not be generated
i think it's because the column in the api folder is just an interface whilst the column should be an angular component to replace the "p-column" selector tag.
primeng\components\api\column.d.ts
column class @github
https://github.com/primefaces/primeng/b ... /column.ts
As i see from github project page, the column calss will be avaible in v0.7
PS: a simple workaround i'm using
html template
.ts component
primeng\components\api\column.d.ts
Code: Select all
export interface Column {
field: any;
header?: any;
footer?: any;
sortable?: any;
editable?: any;
filter?: any;
filterMatchMode?: any;
rowspan?: any;
colspan?: any;
style?: any;
styleClass?: any;
}
https://github.com/primefaces/primeng/b ... /column.ts
As i see from github project page, the column calss will be avaible in v0.7
PS: a simple workaround i'm using
html template
Code: Select all
<p-dataTable [value]="my_data"
[columns]="my_cols"
</p-dataTable>
Code: Select all
import { Column } from 'primeng/components/api/column';
@Component
({
selector: 'my-table',
templateUrl: "path/to/my/template.html",
directives: [ DataTable ]
})
export class AppComponent
{
my_data: MyDataObject[];
my_cols: Column [];
constructor() { }
ngOnInit()
{
this.cols = [
{field: 'col1', header: 'Column 1' },
{field: "col2", header: "Column 2" } ];
}
}
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Please note that the live showcase runs on 0.7-SNAPSHOT that introduced the Column as a component, as of 0.6, it is an interface. With 0.7 columns are defined using p-column elements instead of columns property which is removed. The gain is major though which is the ability to place custom content in cells;
http://www.primefaces.org/primeng/#/datatabletemplating
This is a breaking change for 0.7 that comes out on 14th, monday.
http://www.primefaces.org/primeng/#/datatabletemplating
This is a breaking change for 0.7 that comes out on 14th, monday.
Good morning,
PrimeNG 0.7 as of this morning fails to display data after restructuring to the new column component format:
Excerpt from the array of columns:
component:
PrimeNG 0.7 as of this morning fails to display data after restructuring to the new column component format:
Excerpt from the array of columns:
Code: Select all
0: Column
editable: false
field: "name"
header: "Name"
sortable: false
__proto__: Column
1: Column
editable: true
field: "type"
header: "Type"
sortable: true
__proto__: Column
2: Column
editable: true
field: "activated"
header: "Activate Limit"
sortable: true
__proto__: Column
(and so on)
Code: Select all
import { Component, OnInit } from "angular2/core";
import { DataTable, Column } from "primeng/primeng";
import { XmlService } from "./xml.service";
@Component({
selector: "limit-limits",
/* template: `
<h1>Limits</h1>
<p-dataTable [(value)]="limitsData" [columns]="limitsCols" [editable]="true">
</p-dataTable>
`,*/
template: `
<h1>Limits</h1>
<p-dataTable [value]="limitsData">
<p-column *ngFor="#col of limitsCols" [field]="col.field" [header]="col.header"></p-column>
</p-dataTable>`,
directives: [DataTable],
providers: [XmlService],
})
export class LimitsComponent implements OnInit {
limitsData: any[] = [];
limitsCols: Column[] = [];
(continues to generate data)
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Could you please create a new post to track it better?
-
- Information
-
Who is online
Users browsing this forum: No registered users and 20 guests