Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'total' of undefined #1140

Closed
metekorkmaz opened this issue Nov 20, 2017 · 7 comments
Closed

Cannot read property 'total' of undefined #1140

metekorkmaz opened this issue Nov 20, 2017 · 7 comments

Comments

@metekorkmaz
Copy link

metekorkmaz commented Nov 20, 2017

I have a problem. Angular 5
`

// component tpl
<ngx-datatable
[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)

@wojtek1150
Copy link

Got same error :/

@FrancescoBorzi
Copy link
Contributor

FrancescoBorzi commented Nov 20, 2017

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

@mmahmad
Copy link

mmahmad commented Nov 20, 2017

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

@FrancescoBorzi
Copy link
Contributor

reverting to 11.0.4 apparently solves the issue for me

@wojtek1150
Copy link

@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

@amcdnl
Copy link
Contributor

amcdnl commented Nov 20, 2017

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

@amcdnl
Copy link
Contributor

amcdnl commented Nov 20, 2017

See 11.1.2

@amcdnl amcdnl closed this as completed Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants