0
votes

i'm trying to use primeng dataTable with the following properties: editable='true' rowGroupMode="rowspan"

but it seems like these two properties can't work together. When trying to edit a table grouped cell I'm getting this error:

ERROR TypeError: Cannot read property 'index' of undefined
at Object.eval [as updateDirectives] (datatable.d.ts.TableBody.html:23)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:14689)
at checkAndUpdateView (core.js:13836)
at callViewAction (core.js:14187)
at execEmbeddedViewsAction (core.js:14145)
at checkAndUpdateView (core.js:13837)
at callViewAction (core.js:14187)
at execEmbeddedViewsAction (core.js:14145)
at checkAndUpdateView (core.js:13837)
at callViewAction (core.js:14187)

I've tried it with angular 4 and angular 5 with no success.

This is my HTML code:

<p-dataTable #dt [value]="newData" [editable]="true" editMode="row" editingRow="true" [rows]="15" rowGroupMode="rowspan" sortField="resourceGroup">
            <ng-container *ngFor="let col of cols">
                <p-column [field]="col.field" [header]="col.header" [editable]="col.editable"></p-column>
            </ng-container>
</p-dataTable>
1
can you show me the whole code line starting from there div tags - Hrishikesh Kale

1 Answers

0
votes

use [editable]="true" on table as well as on column like

<p-dataTable [value]="yourArray" [editable]="true">
 <p-column field="yourField" header="yourHeader" [editable]="true"></p-column>