Schedule component popupOPen

In reacjs syncfusion ej2-react-schedule i want to open custom popup on single click of scheduler is it possible? currently custom popup open on double click of cell


1 Reply

SK Satheesh Kumar Balasubramanian Syncfusion Team December 18, 2023 02:46 PM UTC

Hi TRUONG,


You can open a custom popup with a single click using the cellClick event as shown in the below code snippets.


https://stackblitz.com/edit/ej2-react-open-editor-popup-on-single-click?file=index.js


index.js:

const Events = () => {

  const [eventLog, setEventLog] = useState('');
  let scheduleObj = useRef(null);
  let eventObj = useRef(null);
  const data = extend([], dataSource.scheduleData, null, true);
  const onClear = () => {
    setEventLog('');
  };
  const onCellClick = (args) => {
    args.cancel = true;
    let cellData = {
      startTime: args.startTime,
      endTime: args.endTime,
    };
    scheduleObj.current.openEditor(cellData, 'Add'); // Open your custom popup here
  };
  return (
    <div className="schedule-control-section">
      <div className="col-lg-9 control-section">
        <div className="control-wrapper">
          <ScheduleComponent
            ref={scheduleObj}
            width="100%"
            height="650px"
            selectedDate={new Date(2021, 0, 10)}
            eventSettings={{ dataSource: data }}
            cellClick={onCellClick}
          >
            <Inject
              services={[
                Day,
                Week,
                WorkWeek,
                Month,
                Agenda,
                Resize,
                DragAndDrop,
              ]}
            />
          </ScheduleComponent>
        </div>
      </div>
    </div>
  );
};
export default Events;

Regards,
Satheesh

Loader.
Up arrow icon