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

Error on header click if timeAxis filter is applied #2431

Closed
matsbryntse opened this issue Feb 23, 2021 · 1 comment
Closed

Error on header click if timeAxis filter is applied #2431

matsbryntse opened this issue Feb 23, 2021 · 1 comment
Labels
bug Something isn't working forum Issues from forum

Comments

@matsbryntse
Copy link
Member

matsbryntse commented Feb 23, 2021

Forum post


t.it('Should fire timeaxisheaderclick event when time axis is filtered', async t => {
        scheduler = t.getScheduler({
            startDate   : new Date(2021, 1, 7),
            endDate     : new Date(2021, 1, 14),
            visibleDate : new Date(2021, 1, 14),
            viewPreset  : {
                tickWidth      : 24,
                tickHeight     : 50,
                timeResolution : {
                    unit      : 'minute',
                    increment : 15
                },
                headers : [
                    {
                        unit       : 'day',
                        increment  : 1,
                        dateFormat : 'ddd DD/MM'
                    },
                    {
                        unit       : 'hour',
                        dateFormat : 'HH '
                    }
                ]
            }
        }, 1);

        scheduler.timeAxis.filterBy(function(tick) {
            return tick.startDate.getDay() % 2 !== 0;
        });

        t.willFireNTimes(scheduler, 'timeaxisheaderclick', 1);

        scheduler.on('timeaxisheaderclick', ({ startDate, endDate }) => {
            t.is(startDate, new Date(), 'Correct start');
            t.is(endDate, new Date(), 'Correct end');
        });

        await t.click('.b-sch-header-timeaxis-cell:contains(Fri)');
    });

Hi,

There is such an error on click on the last day of week header if timeAxis filter is applied.

scheduler.module.js ? 447702 : 102 Uncaught TypeError:
Cannot read property 'start' of undefined
at TimeAxisColumn.onContainerElementClick(scheduler.module.js ? 447702 : 102)
at HTMLDivElement._0x88abbf(scheduler.module.js ? 447702 : 10)

To reproduce it, you can replace scheduler in the Basic demo https://www.bryntum.com/examples/scheduler/basic/ with this code and click on Friday header.

import {
    Scheduler
}
from '../../build/scheduler.module.js?447702';
import shared from '../_shared/shared.module.js?447702';
/* eslint-disable no-unused-vars */

​
const scheduler = new Scheduler({
    appendTo: 'container',
    minHeight: '20em',
    resources: [],
    events: [],
    zoomOnMouseWheel: false,
    zoomOnTimeAxisDoubleClick: false,
    startDate: new Date(2021, 1, 7),
    endDate: new Date(2021, 1, 14),
    viewPreset: {
        tickWidth: 24,
        tickHeight: 50,
        timeResolution: {
            unit: "minute",
            increment: 15
        },
        headers: [{
                unit: 'day',
                increment: 1,
                dateFormat: 'ddd DD/MM'
            },
            {
                unit: "hour",
                dateFormat: 'HH '
            }
        ]
    },
    rowHeight: 50,
    barMargin: 5,
    
columns: [{
    text: 'Name',
    field: 'name',
    width: 130
}],
listeners: {
    timeAxisHeaderClick: function(cfg) {
        console.log('OK');
    }
}
});​
scheduler.timeAxis.filterBy(function(tick) {
    return tick.startDate.getDay() % 2 !== 0;
});
@matsbryntse matsbryntse added bug Something isn't working forum Issues from forum labels Feb 23, 2021
@isglass isglass added this to the 4.1.2 milestone Feb 24, 2021
@isglass isglass modified the milestones: 4.1.2, 4.1.3, 4.1.x Apr 27, 2021
@matsbryntse matsbryntse added high-priority Urgent to have fixed and removed high-priority Urgent to have fixed labels Jun 22, 2021
@matsbryntse matsbryntse removed this from the 4.1.x milestone Jun 22, 2021
@matsbryntse
Copy link
Member Author

Not reproducible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum
Projects
None yet
Development

No branches or pull requests

2 participants