Our pure JavaScript Scheduler component


Post by Jammb »

How to Disable event drag feature from preventing user from
creating a new event In react typescript. I am using scheduler as a wrapper.


Post by fabio.mazza »

Hi jammb,

To avoid create event on drag, you can just disable the feature https://www.bryntum.com/docs/scheduler/#Scheduler/feature/EventDragCreate:

new Scheduler({
    ...
    features: {
        eventDragCreate: false
    },
    ...    
});

It is enabled by default.

Please check and let me know if you have any question.

Best regards,
Fabio


Post by Jammb »

Hi Fabio,
I did try that.

Attachments
Capture.PNG
Capture.PNG (26.14 KiB) Viewed 1392 times

Post by alex.l »

Hi Jammb,

Please check this guide:
https://bryntum.com/docs/scheduler/#guides/integration/react.md

To manage features in React wrapper, you need to use feature suffix:

eventDragCreateFeature = {false}

All best,
Alex

All the best,
Alex


Post by Jammb »

I did try that and still I am able to drag and create an event.

Attachments
Capture.PNG
Capture.PNG (23.44 KiB) Viewed 1385 times

Post by fabio.mazza »

Hi Jammb,

Please, post your code using "Code display" button on editor forum instead of screenshot it, will be good for us to copy when needed. Screenshots are good to show the browse result on your UI.

I have tested on scheduler/examples/react/javascript/simple and is working fine.
/src/containers/Main.js:

...
<BryntumScheduler
                    ref={'scheduler'}

                // Make grid grow to fit rows
                autoHeight={true}

                // Initial row height
                barMargin={this.state.barMargin}

                startDate={new Date(2017, 1, 7, 8)}
                endDate={new Date(2017, 1, 7, 18)}
                eventDragCreateFeature = {false}
                ...

Please, create a simple case test then we can check your problem specifically.

Best regards,
Fabio


Post by Jammb »

   <Scheduler
      eventDragCreateFeature = {false}
      onBeforeEventEditShow= {(selected : any) => handleChange(selected)}
      change= {(selected : any) => handleChange(selected)}
      rowHeight= {40}
      cellEditFeature={{
        triggerEvent: 'cellclick'
    }}
        eventsVersion={eventsVersion}
        resourcesVersion={resourcesVersion}
        events={events}
        resources={resources}
        startDate={getStartDate(scheduleDay)}
        endDate={getendDate(scheduleDay)}
        eventBodyTemplate = {(data : any) => div(data)}
        eventRenderer={( selected : any) => check(selected)}
        eventEditFeature={{
          showRecurringUI : false,
       }}
       ></Scheduler>

I did try the same. Still I am able to create an by dragging.


Post by saki »

I have tried it in version 3.1.9 which is the latest stable release of Bryntum Scheduler in typescript/basic. I've added one line to App.tsx:

<BryntumScheduler
    eventDragCreateFeature = { false }
    // ...

Then I used:

npm i
npm i typescript@latest # otherwise compile fails
npm start

Events now cannot be created by dragging.

Note: It is possible that for earlier versions of Scheduler there is a wrapper that does not support eventDragCreateFeature. If you use an older version, check if the feature is listed in BryntumScheduler.js which implements the wrapper.


Post by Jammb »

Hi I have attached the implementation of event drage create and set it to false still I am able to drag create an event.

Attachments
recurring-events.zip
(988.43 KiB) Downloaded 94 times

Post by saki »

See my response to this thread viewtopic.php?f=44&t=15227

I believe the problem also lies in the wrapper implementation.


Post Reply