Premium support for our pure JavaScript UI components


Post by gorakh.nath »

Hi team,
I added eventClick in handler under listeners it is working as expected but in one of the use case we don't want this handler to call. How I can disable this for one of event object.
for example my events array are like this:-

      {
          "workOrderTaskAppointmentWindowStartDate": "2023-01-11 13:30:00.000",
          "minStartDate": "2023-01-11 13:30:00.000",
          "maxEndDate": "2023-01-11 17:30:00.000",
          "resourceId": "19CDQQBDNW",
          "workOrderTypeId": "VPHX9O8BRF",
          "endDate": "2023-01-11 16:30:00.000",
          "statusColor": "#0aa9c2",
          "customerCompanyName": "VD Inc",
          "regionName": "Bengaluru",
          "siteName": "VD Site",
          "type": "Corrective Maintenance - Single Technician",
          "taskAtRisk": 1,
          "taskTypeName": "Corrective Maintenance - Single Technician",
          "tooltipHeader": "<b>Corrective Maintenance - Single Technician</b><br/>TSK000018",
          "taskTypeId": "L4SW9O8XJU",
          "scheduledStartTime": "2023-01-11 15:30:00.000",
          "customerId": "RQSURLB09A",
          "workOrderTaskId": "TSK000018",
          "workOrderTaskEstimatedDuration": 1,
          "id": "C3NSRRCONN-19CDQQBDNW",
          "multiBreakdownTaskFlag": false,
          "deadline": "2023-01-16 06:30:00.000",
          "workOrderTaskEstimatedDurationMinutes": 60,
          "workOrderTaskAppointmentWindowEndDate": "2023-01-11 17:30:00.000",
          "priorityIndex": "10",
          "alloweEventOverlap": false,
          "workOrderTaskAppointmentWindowId": "3QSXPRCH5",
          "scheduledEndTime": "2023-01-11 16:30:00",
          "resultWebPageId": "GEZKCPA4BA",
          "taskTypeCrewTask": 0,
          "crewTask": 0,
          "workOrderTaskTypeId": "L4SW9O8XJU",
          "statusId": "workOrderTaskScheduled",
          "regionId": "LCXERLBEX0",
          "eventColor": "#0aa9c2",
          "name": "[High] TSK000018",
          "workOrderTaskScheduledDate": "2023-01-11 15:30:00.000",
          "workOrderRequestedDate": "2023-01-10 09:37:33.320",
          "startDate": "2023-01-11 15:30:00.000",
          "status": "Scheduled"
        },

Like this object we have other event object in array, Is any property that we can pass that will restrict to call the eventClick event handler?


Post by marcio »

Hey gorakh.nath,

You can try the following,

listeners    : {
            eventClick : ({ event }) => {
                if (condition) {
                    event.preventDefault();
                    event.stopPropagation();
                }
            }
        }

https://bryntum.com/products/schedulerpro/docs/api/Scheduler/view/mixin/SchedulerDomEvents#event-eventClick

Best regards,
Márcio


Post Reply