Our pure JavaScript Scheduler component


Post by Fred »

Hi,
I'm using Scheduler Pro and trying to couple nested events with fixed sub-event tasks durations. When user moves the entire nested event over a non-working day, it should expand so that days off are filled with the dashed grey color (like in the demo).

This demo shows the nested event rendering but is doesn't show expansion over non working days
https://www.bryntum.com/examples/scheduler-pro/nested-events/

This one illustrates the expansion mechanism but it uses regular events (and not nested ones)
https://www.bryntum.com/examples/scheduler-pro/weekends/

Starting from this last demo with following custom calendar:

"project"            : {
        "calendar" : "off"
    },
    "calendars"          : {
        "rows" : [
            {
                "id"        : "off",
                "name"      : "non working",
                "intervals" : [
                    {
                        "recurrentStartDate" : "on Sat at 0:00",
                        "recurrentEndDate"   : "on Mon at 0:00",
                        "isWorking"          : false
                    },
                    {
                        "startDate"          : "2020-12-25",
                        "endDate"            : "2020-12-26",
                        "isWorking"          : false
                    }
                ]
            }
        ]
    },

I added some data that comply with the nested format

"events"             : {
        "rows" : [
            {
                "id"         : 2,
                "resourceId" : 1,
                "startDate"  : "2020-12-01",
                "duration"   : 3,
                "name"       : "COGESTEN",
                "eventColor" : "purple",
                "resizable" : false,
                "agenda"     : [
                    {
                        "name"      : "F",
                        "startDate" : "2020-12-01",
                        "duration"  : 2
                    },
                    {
                        "name"      : "L",
                        "startDate" : "2020-12-03",
                        "duration"  : 1
                    }
                ]
            }
        ]
    },
    "resourceTimeRanges" : {
        "rows" : [
            {
                "id"         : 1,
                "resourceId" : 3,
                "name"       : "Unavailable",
                "startDate"  : "2020-11-29",
                "endDate"    : "2021-01-03",
                "timeRangeColor" : "red"
            }
        ]
    }
}

I copied / pasted pieces of code from the nested demo in the events it should be.
I load the .json file with load function

project.load();

No error in console but the sub-events texts are rendered all in the same cell

Screenshot 2020-11-25 at 01.59.09.png
Screenshot 2020-11-25 at 01.59.09.png (33.26 KiB) Viewed 1174 times

Should I start with the nested demo first instead ?
Is this at all possible ?


Post by alex.l »

Hi Fred,

It is not supported now in our demo example and it's not something easy to implement, I've created a feature request, so we will add this functionality, here is the link: https://github.com/bryntum/support/issues/1959

All best,
Alex

All the best,
Alex


Post by Fred »

Too bad. As a work around, using regular events, I could display the various dates of my event sub-tasks in the event editor. I saw I can put custom tab and custom fields in there. Do I have access to whether a day is working or not ? Maybe as a DateHelper function ?
I'd loop from startDate to endDate, and for each iteration, I'd evaluate whether the day is working on not.
Thanks anyway.
Fred


Post by alex.l »

Hi Fred,

Try to use:

task.effectiveCalendar.isWorkingTime(startDate, endDate);
// and/or
resource.effectiveCalendar.isWorkingTime(startDate, endDate);

This is a method from the scheduling-engine: https://www.bryntum.com/docs/gantt/engine/classes/_lib_engine_quark_model_abstractcalendarmixin_.abstractcalendarmixin.html#isworkingtime

All the best,
Alex

All the best,
Alex


Post Reply