I'm trying to use the SelectedDateChanged() event but I get two callbacks each time the user changes date.
The first callback has the correct value (the newly selected date), the second call indicates the date the schedule was initialised with.
I'm new to Blazor and the SyncFusion - am I missing something obvious here or is this a bug?
Here is an example based on your LocalData sample:
<div class="col-lg-12 control-section">
<div class="schedule-wrapper">
<EjsSchedule @ref="ScheduleObj" @ref:suppressField TValue="AppointmentData" Width="100%" Height="650px" SelectedDate="@(new DateTime(2019, 1, 10))" SelectedDateChanged="@SelectedDateChanged">
<ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
</EjsSchedule>
</div>
</div>
@code{
protected void SelectedDateChanged(DateTime dt)
{
System.Console.WriteLine($"Date change event {dt.ToString()}");
}
}
Console Output:
blazor.webassembly.js:1 Blazor is running in dev mode without IL stripping. To make the bundle size significantly smaller, publish the application or see https://go.microsoft.com/fwlink/?linkid=870414
blazor.webassembly.js:1 Debugging hotkey: Shift+Alt+D (when application has focus)
blazor.webassembly.js:1 WASM: GC_MAJOR_SWEEP: major size: 9328K in use: 13098K
blazor.webassembly.js:1 WASM: GC_MAJOR: (LOS overflow) time 25.19ms, stw 25.59ms los size: 6176K in use: 3493K
ej2.min.js:1 Uncaught TypeError: Cannot read property 'querySelector' of null
at N (ej2.min.js:1)
at t.setActiveBorder (ej2.min.js:1)
at t.refreshActiveBorder (ej2.min.js:1)
at t.refreshActElePosition (ej2.min.js:1)
blazor.webassembly.js:1 WASM: Date change event 17/01/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 10/01/2019 00:00:00
blazor.webassembly.js:1 WASM: GC_MINOR: (Nursery full) time 3.64ms, stw 3.69ms promoted 393K major size: 9408K in use: 3182K los size: 7200K in use: 6731K
blazor.webassembly.js:1 WASM: Date change event 24/01/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 10/01/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 31/01/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 10/01/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 07/02/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 10/01/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 14/02/2019 00:00:00
blazor.webassembly.js:1 WASM: Date change event 10/01/2019 00:00:00