Is there a way to disable calendar component?

Hi,

We have a web application and depending on value of certain checkbox, Calendar component should become enabled or disabled.
Unfortunately, Syncfusion Calendar component for Blazor does not have a CssClass nor Enabled property as many other components. How do we solve this issue?

5 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team September 29, 2020 09:59 AM UTC

Hi Peder, 



Greetings from Syncfusion support. 


We validated the reported requirement. You can add the custom class to the component using the HtmlAttributes property. We suggest adding an e-disabled class through the HtmlAttributes property to disable the component. Add the style below to disable the component. Refer to the code below, 


<SfCalendar TValue="DateTime" HtmlAttributes="@htmlAttributes" ></SfCalendar> 
 
 
@code { 
 
    public Dictionary<string, object> htmlAttributes { get; set; } = new Dictionary<string, object>() { { "class", "e-disabled" } }; 
} 
 
 
<style> 
 
    .e-control.e-calendar.e-disabled{ 
            pointer-events: none; 
    } 
</style> 
 

Please find the sample below, 




Screenshot: 

 



Please check the above sample and get back to us if you need further assistance. 


Regards, 
Sevvandhi N 


Marked as answer

PG Peder Guzova September 29, 2020 04:45 PM UTC

Hello Sevvandhi,

interesting solution! Although it works I feel it's just a workaround.
Namely, after having added e-disabled class to the component using HtmlAttributes property as in your example, added class (e-disabled) cannot be removed after it is ingested by Calendar component. I've tried re-setting my dictionary, clearing it etc..

I assume there is no real solution to this and Syncfusion should add Enabled property (CssClass would also be nice) which seems to exist on all other Blazor time-components?


SN Sevvandhi Nagulan Syncfusion Team October 1, 2020 05:59 AM UTC

Hi Peder,  



We are considering this (“Provide support for Enabled and CssClass property”) as an improvement at our end.  This support will be available in second patch release after volume 3 release which will be expected to be roll out on 14th , October 2020. You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/18361/ 


Regards,  

Sevvandhi N 



PG Peder Guzova October 1, 2020 07:29 AM UTC

Great! Thanks you, we will be keeping an eye on it!


BC Berly Christopher Syncfusion Team October 2, 2020 11:37 AM UTC

Hi Peder, 
  
We will update you once implementation has been rolled out from our end.  
  
Regards, 
Berly B.C 


Loader.
Up arrow icon