Hello Guys,
I have recently upgraded to Angular2 RC4 and after that i am facing few errors in Primeng Components.
1) On Data table column, I want to set some custom style but now it throws exception
<p-dataTable [value]="GridOptions['rowData']" resizableColumns="true" [responsive]="true">
<div *ngFor="let col of GridOptions['columnDefs']">
<p-column [field]="col.field" [header]="col.header" [sortable]="true" [style]="col.style"></p-column>
</div>
</p-dataTable>
ColumnDefs item as like this,
GridOptions['columnDefs'].push({
header: "",
field: fieldStr,
style: "{'width':'50px', 'text-align': 'center'}",
hasDeleteButtonOnRows: true,
});
Error On style as follows,
platform-browser.umd.js:1900 ORIGINAL EXCEPTION: Cannot find a differ supporting object '{'width':'50px', 'text-align': 'center'}'
Error: Cannot find a differ supporting object '{'width':'50px', 'text-align': 'center'}'
at new BaseException (core.umd.js:4412)
at KeyValueDiffers.find (core.umd.js:7915)
at NgStyle.set [as rawStyle] (common.umd.js:2002)
at DebugAppView._View_DataTable4.detectChangesInternal (DataTable.template.js:689)
at DebugAppView.AppView.detectChanges (core.umd.js:12143)
at DebugAppView.detectChanges (core.umd.js:12247)
at DebugAppView.AppView.detectContentChildrenChanges (core.umd.js:12161)
at DebugAppView._View_DataTable3.detectChangesInternal (DataTable.template.js:540)
at DebugAppView.AppView.detectChanges (core.umd.js:12143)
at DebugAppView.detectChanges (core.umd.js:12247)
https://pl.vc/1lqkgt
Can you please suggest why it appended signle quotes in style string?
Awaiting for your response.
Data table Column style Error
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Style should be an object, not a string;
Code: Select all
style: {'width':'50px', 'text-align': 'center'},
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Glad to hear!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 35 guests