We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Editor template per event

Is it  possible to have editor window different for different events?

seems editorTemplate function executes  once and  just use evaluated template later


Or maybe its possible to configure fields definitions to make  some fields readonly/hidden in editor?
can I use any conditions based on event data in editor?

1 Reply

NR Nevitha Ravi Syncfusion Team April 24, 2019 09:58 AM UTC

Dear Customer, 

Greetings from Syncfusion Support. 

We have prepared sample to hidden some of the fields from the editor window based the value of EventType field which can be viewed from the following link. 

  onPopupOpen(args) { 
    if (args.type === 'Editor') { 
      let statusElement = args.element.querySelector('#EventType'); 
      statusElement.setAttribute('name', 'EventType'); 
      if (args.target.classList.contains("e-appointment")) { 
        if (args.data.EventType == 'Confirmed') { 
          classList(args.element.querySelector("#summaryRow"), ["disable"], ["enable"]); 
          classList(args.element.querySelector("#reasonRow"), ["disable"], ["enable"]); 
        } 
        else if (args.data.EventType == 'Requested') { 
          classList(args.element.querySelector("#reasonRow"), ["disable"], ["enable"]); 
          classList(args.element.querySelector("#summaryRow"), ["enable"], ["disable"]); 
        } else if (args.data.EventType == 'New') { 
          classList(args.element.querySelector("#summaryRow"), ["enable"], ["disable"]); 
          classList(args.element.querySelector("#reasonRow"), ["enable"], ["disable"]); 
        } 
      } else { 
        classList(args.element.querySelector("#summaryRow"), ["enable"], ["disable"]); 
        classList(args.element.querySelector("#reasonRow"), ["enable"], ["disable"]); 
      } 
    } 
  } 

.disable { 
  display: none; 
} 
.enable { 
  display: table-row; 
} 

Please try out the sample and revert us back if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Live Chat Icon For mobile
Up arrow icon