Close Custom Editor Window with React Functional Component and Custom Editor

Hello,

Could someone kindly advise how to close a custom editor window using React functional components? I am using a reference to the scheduler object and closeEditor (e.g., scheduleRef.closeEditor()), but nothing happens after I call the function.

Thanks!


1 Reply 1 reply marked as answer

VD Vinitha Devi Murugan Syncfusion Team September 5, 2022 12:48 PM UTC

Hi Drew,


Greetings from Syncfusion Support.


We have validated your requirement “how to close a custom editor window using React functional components” at our end. We achieved your requirement by using below code. We have prepared simple sample for your reference.


https://stackblitz.com/edit/scheduler-using-functional-componets-close-editor-window?file=components%2Fchild.js


let
scheduleInst;


function
Schedule() {

  function
CloseEditorWindow() {

    scheduleInst.closeEditor();

  }


  return (

    <>

      <button
onClick={() =>
CloseEditorWindow()}>close editor</button>


      <ScheduleComponent

        id={'Schedule'}

        ref={(schedule=> (scheduleInst = schedule)}

        width="100%"

….

…>



Kindly try with the above sample and get back to us if you need any further assistance.


Regards,

Vinitha


Marked as answer
Loader.
Up arrow icon