Ngx-datatable: Cannot read property 'total' of undefined

Created on 20 Nov 2017  路  7Comments  路  Source: swimlane/ngx-datatable

I have a problem. Angular 5
`

// component tpl
[rows]="rows"
[columns]="columns"
>

// component
rows = [
{ name: 'Austin', gender: 'Male', company: 'Swimlane' },
{ name: 'Dany', gender: 'Male', company: 'KFC' },
{ name: 'Molly', gender: 'Female', company: 'Burger King' },
]

columns = [
{ prop: 'name' },
{ name: 'Gender' },
{ name: 'Company' }
]

`
DataTableBodyComponent.html:15 ERROR TypeError: Cannot read property 'total' of undefined
at Object.eval [as updateDirectives] (DataTableBodyComponent.html:20)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:14339)
at checkAndUpdateView (core.js:13508)
at callViewAction (core.js:13858)
at execEmbeddedViewsAction (core.js:13816)
at checkAndUpdateView (core.js:13509)
at callWithDebugContext (core.js:14740)
at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:14277)
at ViewRef_.detectChanges (core.js:11300)
at DataTableBodyComponent../src/components/body/body.component.ts.DataTableBodyComponent.updateRows (index.js:3443)

All 7 comments

Got same error :/

I'm also experiencing similar issues with the latest version.

Same. The exact line of error is: var currVal_5 = _co.columnGroupWidths.total; in
the component DataTableBodyComponent.ngfactory.js

reverting to 11.0.4 apparently solves the issue for me

@ShinDarth Try to add items in [rows]="items" as variable from Input or resolver. This only works if you pass items on start as empty array, they async fill with data

Ok, I've fixed this in the unit tests. I just need to make a new release. Doing so now

See 11.1.2

Was this page helpful?
0 / 5 - 0 ratings