[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior
Got a datatable with external sorting enabled, with custom header templates. If the column is sortable, and the table body contains no rows (showing the emptyMessage: 'No data to display'). And the user decides to sort the 0 rows. It will throw on this line: https://github.com/swimlane/ngx-datatable/blob/master/src/components/body/body.component.ts#L258 because this.scroller is undefined.
stack trace:
vendor.bundle.js?7088:87703 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ vendor.bundle.js?7088:87703
next @ vendor.bundle.js?7088:64486
schedulerFn @ vendor.bundle.js?7088:66568
SafeSubscriber.__tryOrUnsub @ vendor.bundle.js?7088:5410
SafeSubscriber.next @ vendor.bundle.js?7088:5359
Subscriber._next @ vendor.bundle.js?7088:5312
Subscriber.next @ vendor.bundle.js?7088:5276
Subject.next @ vendor.bundle.js?7088:24382
EventEmitter.emit @ vendor.bundle.js?7088:66554
NgZone.triggerError @ vendor.bundle.js?7088:53926
onHandleError @ vendor.bundle.js?7088:53887
ZoneDelegate.handleError @ vendor.bundle.js?7088:131775
Zone.runTask @ vendor.bundle.js?7088:131683
ZoneTask.invoke @ vendor.bundle.js?7088:131874
vendor.bundle.js?7088:87704 TypeError: Cannot read property 'setOffset' of undefined
at DataTableBodyComponent.webpackJsonp.696.DataTableBodyComponent.updateOffsetY (main.bundle.js?7088:7723)
at DatatableComponent.webpackJsonp.700.DatatableComponent.onColumnSort (main.bundle.js?7088:9241)
at View_DatatableComponent1.handleEvent_0 (/NgxDatatableModule/DatatableComponent/component.ngfactory.js:74)
at SafeSubscriber.schedulerFn [as _next] (vendor.bundle.js?7088:66580)
at SafeSubscriber.__tryOrUnsub (vendor.bundle.js?7088:5410)
at SafeSubscriber.next (vendor.bundle.js?7088:5359)
at Subscriber._next (vendor.bundle.js?7088:5312)
at Subscriber.next (vendor.bundle.js?7088:5276)
at EventEmitter.Subject.next (vendor.bundle.js?7088:24382)
at EventEmitter.emit (vendor.bundle.js?7088:66554)
at DataTableHeaderComponent.webpackJsonp.705.DataTableHeaderComponent.onSort (main.bundle.js?7088:10037)
at View_DataTableHeaderComponent2.handleEvent_0 (/NgxDatatableModule/DataTableHeaderComponent/component.ngfactory.js:107)
at SafeSubscriber.schedulerFn [as _next] (vendor.bundle.js?7088:66580)
at SafeSubscriber.__tryOrUnsub (vendor.bundle.js?7088:5410)
at SafeSubscriber.next (vendor.bundle.js?7088:5359)
This is easy to solve, chk if scroller is defined.
I'm submitting a ... (check one with "x")
Current behavior
Got a datatable with external sorting enabled, with custom header templates. If the column is sortable, and the table body contains no rows (showing the
emptyMessage: 'No data to display'
). And the user decides to sort the 0 rows. It will throw on this line: https://github.com/swimlane/ngx-datatable/blob/master/src/components/body/body.component.ts#L258 becausethis.scroller
is undefined.stack trace:
This is easy to solve, chk if scroller is defined.