Our pure JavaScript Scheduler component


Post by mikemcs »

Is there a way where I can allow dependant items to start before the previous event ends? In this example I want 458669-FINIAL to start before 48669-MOLDING ends.

Currently I can only start an Item that has a dependency after the previous Item ends.

I tied to use the Lag option which does allow me to move the 458669-FINIAL to where I want it, however when I hit the refresh button the lag sets the 458669-FINIAL start time to be 48669-MOLDING plus the lag time. See attachment video.

1.jpg
1.jpg (39.42 KiB) Viewed 90 times
{
    "success": true,
    "resources": {
        "rows": [
            {
                "id": 1,
                "name": "WIRE CUTTING",
                "calendar": 1
            },
            {
                "id": 2,
                "name": "FINIAL INSPECTION",
                "calendar": 2
            },
            {
                "id": 3,
                "name": "ASSEMBLY",
                "calendar": 3
            },
            {
                "id": 4,
                "name": "MOLDING",
                "calendar": 4
            }
        ],
        "total": 4
    },
    "events": {
        "rows": [
            {
                "id": 7,
                "name": "458669-WIRE CUTTING",
                "jono": 458669,
                "takt": 3,
                "duration": 0.83333333333333337034076748750521801412105560302734375,
                "durationUnit": "h",
                "startDate": "2024-03-15 05:15:00",
                "endDate": "2024-03-15 06:05:00"
            },
            {
                "id": 8,
                "name": "458669-ASSEMBLY",
                "jono": 458669,
                "takt": 15,
                "duration": 4.16666666666666696272613990004174411296844482421875,
                "durationUnit": "h",
                "startDate": "2024-03-15 07:00:00",
                "endDate": "2024-03-15 11:10:00"
            },
            {
                "id": 9,
                "name": "458669-MOLDING",
                "jono": 458669,
                "takt": 45,
                "duration": 12.5,
                "durationUnit": "h",
                "startDate": "2024-03-15 10:45:00",
                "endDate": "2024-03-15 23:15:00"
            },
            {
                "id": 10,
                "name": "458669-FINIAL INSPECTION",
                "jono": 458669,
                "takt": 10,
                "duration": 2.77777777777777767909128669998608529567718505859375,
                "durationUnit": "h",
                "startDate": "2024-03-15 18:15:00",
                "endDate": "2024-03-15 21:01:00"
            }
        ],
        "total": 4
    },
    "assignments": {
        "rows": [
            {
                "id": 14,
                "eventId": 7,
                "resourceId": 1
            },
            {
                "id": 18,
                "eventId": 8,
                "resourceId": 2
            },
            {
                "id": 19,
                "eventId": 9,
                "resourceId": 3
            },
            {
                "id": 20,
                "eventId": 10,
                "resourceId": 4
            }
        ],
        "total": 4
    },
    "dependencies": {
        "rows": [
            {
                "id": 8,
                "from": 7,
                "to": 8,
                "lag": -1,
                "lagUnit": "hour"
            },
            {
                "id": 9,
                "from": 8,
                "to": 9,
                "lag": -4,
                "lagUnit": "hour"
            },
            {
                "id": 10,
                "from": 9,
                "to": 10,
                "lag": -12,
                "lagUnit": "hour"
            }
        ],
        "total": 3
    },
    "calendars": {
        "rows": [],
        "total": 0
    }
}
Attachments
Media1.mp4
(1.58 MiB) Downloaded 11 times

Post by ghulam.ghous »

Hi mikemcs,

I can see the issue in the video but was not able to reproduce it in our demos. While inspecting the data provided by you, I can see you have used the hour as the lagUnit that's why events are starting before the event on which they are dependent. Please explore using minutes as lagUnit.
https://bryntum.com/products/schedulerpro/docs/api/Scheduler/model/DependencyBaseModel#field-lagUnit

Here's the updated data:

{
    "success": true,
    "resources": {
        "rows": [
            {
                "id": 1,
                "name": "WIRE CUTTING",
                "calendar": 1
            },
            {
                "id": 2,
                "name": "FINIAL INSPECTION",
                "calendar": 2
            },
            {
                "id": 3,
                "name": "ASSEMBLY",
                "calendar": 3
            },
            {
                "id": 4,
                "name": "MOLDING",
                "calendar": 4
            }
        ],
        "total": 4
    },
    "events": {
        "rows": [
            {
                "id": 7,
                "name": "458669-WIRE CUTTING",
                "jono": 458669,
                "takt": 3,
                "duration": 0.83333333333333337034076748750521801412105560302734375,
                "durationUnit": "h",
                "startDate": "2024-03-15 05:15:00",
                "endDate": "2024-03-15 06:05:00"
            },
            {
                "id": 8,
                "name": "458669-ASSEMBLY",
                "jono": 458669,
                "takt": 15,
                "duration": 4.16666666666666696272613990004174411296844482421875,
                "durationUnit": "h",
                "startDate": "2024-03-15 07:00:00",
                "endDate": "2024-03-15 11:10:00"
            },
            {
                "id": 9,
                "name": "458669-MOLDING",
                "jono": 458669,
                "takt": 45,
                "duration": 12.5,
                "durationUnit": "h",
                "startDate": "2024-03-15 10:45:00",
                "endDate": "2024-03-15 23:15:00"
            },
            {
                "id": 10,
                "name": "458669-FINIAL INSPECTION",
                "jono": 458669,
                "takt": 10,
                "duration": 2.77777777777777767909128669998608529567718505859375,
                "durationUnit": "h",
                "startDate": "2024-03-15 18:15:00",
                "endDate": "2024-03-15 21:01:00"
            }
        ],
        "total": 4
    },
    "assignments": {
        "rows": [
            {
                "id": 14,
                "eventId": 7,
                "resourceId": 1
            },
            {
                "id": 18,
                "eventId": 8,
                "resourceId": 2
            },
            {
                "id": 19,
                "eventId": 9,
                "resourceId": 3
            },
            {
                "id": 20,
                "eventId": 10,
                "resourceId": 4
            }
        ],
        "total": 4
    },
    "dependencies": {
        "rows": [
            {
                "id": 8,
                "from": 7,
                "to": 8,
                "lag": -20,
                "lagUnit": "minutes"
            },
            {
                "id": 9,
                "from": 8,
                "to": 9,
                "lag": -20,
                "lagUnit": "minutes"
            },
            {
                "id": 10,
                "from": 9,
                "to": 10,
                "lag": -20,
                "lagUnit": "minutes"
            }
        ],
        "total": 3
    },
    "calendars": {
        "rows": [],
        "total": 0
    }
}

About the issue on refresh, can you please provide us with a runnable test case so we can debug it and reproduce the problem on our end and assist you in a better way.

Regards,
Ghous


Post Reply