primeng icon indicating copy to clipboard operation
primeng copied to clipboard

DataTable selected row not draw as selected when initial draw

Open lukgit17 opened this issue 9 years ago • 4 comments

When is first drawed datatable not draw selected row. Row is drawed as select just if datakey is set like [dataKey]="field". But if is write like [dataKey] then ng build --prod --aot not recognising field.

Angular version: 4.3.1.
Angular cli : 1.3.0-rc.1

PrimeNG version: 4.1.1

lukgit17 avatar Jul 25 '17 10:07 lukgit17

Same issue here with primeng 4.1.2, seems to be a new issue as it is working with 4.0.3 (which has other problems like performance)

mscudlik avatar Aug 08 '17 12:08 mscudlik

Should be dataKey="field" or [dataKey]="'field'"

cagataycivici avatar Aug 23 '17 09:08 cagataycivici

@cagataycivici: I don't know why this is closed?

As a workaround I discovered that you need to use an array for the selectedItem instead of a single reference, even when using selectionMode single

mscudlik avatar Aug 23 '17 13:08 mscudlik

When run with ng serve working ok with [dataKey]="field" , but when build with -prod -aot ng return error ERROR in ng:///E:/Development/web/sycproex/frontend/analytics/src/app/randamente/rapoarte/raport-cantitativ/detalii-transate/detalii-transate.component. html (13,98): Property 'idNod' does not exist on type 'DetaliiTransateComponent'

lukgit17 avatar Aug 24 '17 06:08 lukgit17