Our pure JavaScript Scheduler component


Post by nsarvesh14 »

Team,
How we can restrict drag and drop and event out of window.
As of now we are able to drag and drop out of window and the event is disappearing from the gantt view.
We are getting below error in console.

After getting this error we are not able to perform any action.

Steps to reproduce.
Drag and drop the event out of scheduler view or to the Team view.
https://drive.google.com/file/d/1Go_GziC2yulSYF79j0f07krojIcoKoi7/view?usp=sharing
Please download the video from the above link and help us to fix this.

Uncaught TypeError: Cannot read property 'getTime' of null
    at Function.add (schedulerpro.module.js?5da6:8423)
    at Scheduler.getStartEndDatesFromRectangle (schedulerpro.module.js?5da6:119440)
    at EventDrag.resolveStartEndDates (schedulerpro.module.js?5da6:112557)
    at EventDrag.updateDragContext (schedulerpro.module.js?5da6:111019)
    at EventDrag.onDrop (schedulerpro.module.js?5da6:110830)
    at DragHelper.trigger (schedulerpro.module.js?5da6:5722)
    at DragHelper.finishTranslateDrag (schedulerpro.module.js?5da6:32075)
    at DragHelper.onMouseUp (schedulerpro.module.js?5da6:33631)
    at HTMLDocument.handler (schedulerpro.module.js?5da6:32653)

Post by mats »

  1. How do you configure your Scheduler?
  2. What version are you on? Tried latest?

Post by nsarvesh14 »

1.

<scheduler @viewDetails="viewDetails" @openMenuItem="openMenuItem" @toggleResourceOnMap="showResourceOnMap" 
          @visiblerangechange="loadEventCount"
          v-show="view.toLowerCase() == 'gantt' || view.toLowerCase() == 'map'"
          ref="scheduler" class="h-full" id="schedulerHeight"
          :resources="schedulerConfig.resources"
          :columns="schedulerConfig.columns"
          :events="schedulerConfig.events"
          :minHeight="schedulerConfig.minHeight"
          :startDate="schedulerConfig.startDate"
          :endDate="schedulerConfig.endDate"
          :viewPreset="schedulerConfig.viewPreset"
          :rowHeight="schedulerConfig.rowHeight"
          :barMargin="schedulerConfig.barMargin"
          :multiEventSelect="schedulerConfig.multiEventSelect"
          :mode="schedulerConfig.mode"
          :forceFit="schedulerConfig.forceFit"
          :workingTime="schedulerConfig.workingTime"
          :timeRangesFeature="schedulerConfig.features.timeRanges"
          :stripeFeature="schedulerConfig.features.strike"
          :eventMenuFeature="schedulerConfig.features.eventContextMenu"
          :eventRenderer="schedulerConfig.eventRenderer"
          :eventBodyTemplate="schedulerConfig.eventBodyTemplate"
          :groupFeature="schedulerConfig.features.group"
          :eventStore="schedulerConfig.eventStore"
          :resourceStore="schedulerConfig.resourceStore"
          :resourceTimeRanges="schedulerConfig.resourceTimeRanges"
          :resourceTimeRangesFeature="
            schedulerConfig.features.resourceTimeRanges
          "
          :nonWorkingTimeFeature="schedulerConfig.nonWorkingTimeFeature"
          :eventTooltipFeature="schedulerConfig.features.eventTooltip"
        ></scheduler>

2 . schedulerpro-1.0.2

Last edited by nsarvesh14 on Thu Nov 26, 2020 9:49 am, edited 1 time in total.

Post by mats »

Please use CODE tags when posting code.

  1. Try using latest version?

Post by nsarvesh14 »

Now we are using latest version(schedulerpro-4.0.3) got below error

Attachments
console Capture.JPG
console Capture.JPG (155.49 KiB) Viewed 769 times
UI Capture.JPG
UI Capture.JPG (69.97 KiB) Viewed 769 times

Post by mats »

Seems you have no CSS telling the component how to size itself, it's a bug in your HTML/CSS so have a look there and make sure you tell the component how to size itself.


Post Reply