@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");
}
} |
function change(args) {
var date = document.getElementById("test ").ej2_instances[0];
var value = date.value;
alert(value);
} |
<body>
<app>Loading...</app>
<script src="_framework/components.webassembly.js"></script>
<script src="scripts/datepicker/datepicker.js"></script>
</body>
</html> |