Premium support for our pure JavaScript UI components


Post by ran »

hi,
i try to prevent double click to create event or edit event,
eventEdit: {
          disabled: true
          }
listeners: {
        beforeEventEditShow({eventRecord, editor, eventEdit}) {
          //currently prevent edit dialog
          return false;
          }

so i catched the beforeEventEditShow and return false,
but there is still somthing showed. waht is the correct way to prevent it?
thank you
Attachments
sc.PNG
sc.PNG (7.53 KiB) Viewed 918 times

Post by saki »

To prevent event editing and creating by dragging, add the following to your scheduler properties:
eventEditFeature={false}
eventDragCreateFeature={false}
You do not need the beforeEventEditShow listener.

Post by ran »

did it , still happens
 render() {

   
    let today = new Date(new Date().setHours(0, 0, 0, 0));
    let toDate = new Date(today);
    toDate.setDate(toDate.getDate() + 30);
    return (<div>
        <BryntumScheduler
          ref={'scheduler'}
          autoHeight={true}
          eventStyle={'border'}
          events={this.props.data.events}
          resources={this.props.data.resources}
          resourceTimeRanges={this.props.data.shifts}
          features={this.state.features}
          timeRanges={this.state.timeRanges}
          timeResolution={1}
          eventEditFeature={false}
          eventDragCreateFeature={false}
          dependencies={this.props.data.dependencies}
          listeners={this.state.listeners}
          columns={[
            {text: '', field: 'name', width: 160, disabled: true}
          ]}
          startDate={today}
          endDate={toDate}
        >
      </div>
    )
  }


Post by saki »

I don't know it that could be the reason, but do not assign features as one object. Always break them into individual properties with "Feature" suffix.

Fix that first and if the problem persists post please the code with which we can test/debug it locally.

Post by ran »

hi, i think i didnt explain it well. im trying to disable double click on empty space which creates a new event. i have also tried this on your demos. it doent prevent the double click on an empty schdule

Post by mats »


Post by ran »

works,thanks.

Post Reply