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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Razor Components Calendar

Thread ID:

Created:

Updated:

Platform:

Replies:

144278 Apr 26,2019 10:07 PM UTC Apr 30,2019 10:17 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: Calendar
Raul
Asked On April 26, 2019 10:07 PM UTC

Hi, Im trying to access the value of the selected date on the calendar object, I tried it this way:
<EjsDatePicker Id="test" Change="@ValueChanged"  Start="@Syncfusion.EJ2.RazorComponents.Calendars.CalendarView.Decade" 
                   Depth="@Syncfusion.EJ2.RazorComponents.Calendars.CalendarView.Decade" Format="yyyy">

@functions{
    public object selectedDate;
    protected void ValueChanged(Syncfusion.EJ2.RazorComponents.Calendars.ChangedEventArgs newValue)
    {
        selectedDate = newValue.Value;
    }
But the value is not located in the arguments passed to ValueChanged method....
Best regards!

Ashokkumar Balasubramanian [Syncfusion]
Replied On April 29, 2019 08:48 AM UTC

Hi Raul, 
 
Sorry for the inconvenience. 
 
Currently we were not providing the option to access the value of the selected date on the calendar Object. Already we have the considered this option with Two-way binding support in calendar components. So, we have planned this feature on Vol 1 service pack release which expected to be rolled out on mid of May 2019. You can track the status of this feature on below feedback portal link. 
 
 
Please let us know, if you have any concern on this. 
 
Regards, 
Ashokkumar B. 


Raul
Replied On April 29, 2019 06:49 PM UTC

So, currently I cant access the value in any way?

Ashokkumar Balasubramanian [Syncfusion]
Replied On April 30, 2019 10:17 AM UTC

Hi Raul, 
 
Yes. You can able access the calendar component values by using component instance. Please check the below code block. 
 
index.cshtml] 
 
@page "/" 
 
@inject IJSRuntime JsRuntime; 
@using Syncfusion.EJ2.RazorComponents.Calendars; 
<div id="wrapper"> 
   <EjsDatePicker Id="test" Change="@Change" Start="@Syncfusion.EJ2.RazorComponents.Calendars.CalendarView.Decade"                   Depth="@Syncfusion.EJ2.RazorComponents.Calendars.CalendarView.Decade" Format="yyyy"> 
</div> 
@functions{ 
 
EjsDatePicker dueDatePicker; 
protected async void Change (object args) 
    { 
    await JsRuntime.InvokeAsync<bool> 
    ("change");  
    } 
    } 
 
[wwwrrot/scripts/datepicker/datepicker.js] 
 
function change(args) { 
    var date = document.getElementById("test ").ej2_instances[0]; 
    var value = date.value; 
    alert(value); 
} 
 
[wwwrrot/scripts/index.cshtml] 
 
<body> 
    <app>Loading...</app> 
 
    <script src="_framework/components.webassembly.js"></script> 
    <script src="scripts/datepicker/datepicker.js"></script> 
</body> 
</html> 
 
 
Please let us know, if you have any concern on this. 
 
Regards, 
Ashokkumar B. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon