Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    timeline setHeaderLevels in combination with eventSnapGap throws error on background click

    Hello,
    when the property
    eventSnapGap
    is set and a change to the HeaderLevels is made via
    .SetHeaderLevel a warning is sent to the console.
    Invalid eventSnapGap - 30 minutes - altered to the lowest sensible...
    A Click on the background throws an javascript error.
    Browser : chrome latest version
    smartclient version:v13.0p_2023-07-23/Pro Development Only
    OS: windows 11
    demo code:
    Code:
    var developers = [
        { name: "charlesMadigen", title: "Charles Madigen" },
        { name: "tamaraKane", title: "Tamara Kane" },
        { name: "darcyFeeney", title: "Darcy Feeney" },
        { name: "kaiKong", title: "Kai Kong" },
        { name: "shellyFewel", title: "Shelly Fewel" },
        { name: "garretMonroe", title: "Garret Monroe" }
    ];
    
    var _calStart = isc.DateUtil.getStartOf(new Date(2020, 6, 4), "W");
    var _calEnd = _calStart.duplicate();
    _calEnd.setDate(_calEnd.getDate() + 21);
    
    
    isc.Timeline.create({
        ID: "timeline",
        height: 475,
        startDate: _calStart,
        endDate: _calEnd,
        data: events,
        eventSnapGap : 30,
        lanes: developers,
        headerLevels: [ { unit: "week" }, { unit: "day" } ],
        laneFields: [ { name: "title", title: "Developer", minWidth: 120, autoFitWidth: true } ],
        canEditLane: true,
        showEventDescriptions: false,
        columnsPerPage: 5
    });
    
    isc.Button.create({
       ID: "setHeader",
       title: "set Header",
       click : function () {
       var HeaderLevel = [{
               unit : "week"
        },
            {unit : "day",
           headerWidth : 30
            }
       ];
       timeline.setHeaderLevels(HeaderLevel);
       }
    });



    #2
    We'll take a look at the crash and update here when it's fixed.

    In the meantime, the reason it happens is that you're asking for snapGaps every 30 minutes in a column which is only 30px wide and covers 24 hours. Since each snap needs at least 1px, you'd need at least 48px to show 24 hours worth of 30-minute snaps.
    Last edited by Isomorphic; 25 Jul 2023, 02:27.

    Comment

    Working...
    X