How to disable add or edit depending on specific case or specific value

Hi,

Q1- How to disable add or edit events in scheduler depending on specific case or specific value?


Thank you very much


1 Reply

PN Praveenkumar Narasimhanaidu Syncfusion Team August 16, 2021 12:30 PM UTC

Hi Ahmed, 

Greetings from Syncfusion support..! 

We have validated your query “How to disable add or edit events in scheduler depending on specific case or specific value?” at our end. You can achieve this requirement with the help of scheduler’s actionBegin event. We have prepared a sample for your reference which can be available from following link. 


<script type="text/javascript"> 
    function onActionBegin(args) { 
        if (args.requestType === 'eventCreate') { 
            if (args.data[0].StartTime < new Date()) {  // disable event adding using condition 
                args.cancel = true; 
                alert('Not permitted to adding event'); 
            } 
        } 
        if (args.requestType === 'eventChange') { 
            if (args.data.StartTime < new Date()) { // disable event editing using condition 
                args.cancel = true; 
                alert('Not permitted to editing event'); 
            } 
        } 
    } 
</script > 

Kindly try the above solution and get back to us for further assistance. 

Regards, 
Praveenkumar 
 


Loader.
Up arrow icon