Our pure JavaScript Scheduler component


Post by arucar »

hi again... i have a new problem after upgrade from 2.1 to 3.0.2

in my code i have this:
ngAfterViewInit() {
   // exposing scheduling engine to be easily accessible from console
    window.scheduler = this.scheduler.schedulerEngine;
    // Initialize the start view to the first day of the current month
    const initialDate = new Date();
    initialDate.setDate(1);
    window.scheduler.scrollToDate(initialDate, { block: 'start' });
  }
i have change nothing on that part, only upgrade version, and in my unit test i get this message:
TypeError: me.viewport.round is not a function
    at SubGridScroller.getDeltaTo (https://localhost:9876/_karma_webpack_/src/assets/scheduler/scheduler.module.js:15521:1)
    at SubGridScroller.scrollIntoView (https://localhost:9876/_karma_webpack_/src/assets/scheduler/scheduler.module.js:70543:31)
    at Scheduler.scrollToCoordinate (https://localhost:9876/_karma_webpack_/src/assets/scheduler/scheduler.module.js:103999:1)
    at Scheduler.scrollToDate (https://localhost:9876/_karma_webpack_/src/assets/scheduler/scheduler.module.js:103950:1)
    at GanttViewComponent../src/app/dashboard/gantt-view-container/gant-view/gantt-view.component.ts.GanttViewComponent.ngAfterViewInit (https://localhost:9876/_karma_webpack_/src/app/dashboard/gantt-view-container/gant-view/gantt-view.component.ts:156:22)
    at callProviderLifecycles (https://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:21414:1)
    at callElementProvidersLifecycles (https://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:21388:1)
    at callLifecycleHooksChildrenFirst (https://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:21378:1)
    at checkAndUpdateView (https://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:29448:1)
    at callWithDebugContext (https://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:30309:1)

if i remove:
window.scheduler.scrollToDate(initialDate, { block: 'start' });

i have no more error...
do you have an idea ?

Post by mats »

Do you have a simple test case for us so we can debug this?

Post by arucar »

so.. i have find a quick workaround by mocking ngAfterViewInit in my test.. i have no more time dedicated to work on this task :| so... we can considering it's ok...

Post Reply