create database record
Hi there by scheduler in Blazor i need to create a database record.
in this method OnActionCompleted(Syncfusion.Blazor.Schedule.ActionEventArgs<ActivityAppointment> args)
i don't have the value to save in the record
Could you hepl me please ? THX
OnActionCompleted method you mentioned is triggered after actions like CRUD operations, and you can access the appointment details through the args parameter to save them in your database.I didn't understand, My Code is :
<SfSchedule TValue="ActivityAppointment"
Width="100%"
Height="500px"
@bind-CurrentView="@CurrentView">
<ScheduleEvents TValue="ActivityAppointment" EventRendered="OnEventRendered"
ActionCompleted="OnActionCompleted"
OnActionBegin="OnActionBegin"
DataBinding="DataBindHandler"
>
</ScheduleEvents>
<ScheduleEventSettings DataSource="@ActivityAppointmentsDataSource"></ScheduleEventSettings>
<ScheduleViews>
<ScheduleView Option="View.Day"></ScheduleView>
<ScheduleView Option="View.Week"></ScheduleView>
<ScheduleView Option="View.Month"></ScheduleView>
<ScheduleView Option="View.Agenda"></ScheduleView>
</ScheduleViews>
</SfSchedule>
With this method i write the record
ActivityTicketLookupService.SCreateActivityAppointment(ActivityAppointmentRecord);
in this method i have any Value , no ItemData, no Data. Like DropDown or Combobox or other
public void OnActionBegin(Syncfusion.Blazor.Schedule.ActionEventArgs<ActivityAppointment> args)
{
args.
}
- args.AddedRecords: This contains the data for any newly added events after the save event is triggered.
- args.ChangedRecords: This will hold the details of any events that have been modified.
- args.DeletedRecords: This property provides the records for any deleted events.
THX For all . I was very close by myself but i missed something ......
Is it right to wirte this code ?
Is it right to use Last() or it is better to use one other ?
var Data = args.AddedRecords.Last().StartTime;
In Data i'll have the StartTime ?
Francesco Pruneri,
Yes, your code is correct. Using Last() will retrieve the StartTime from the last record in the AddedRecords collection. As long as you are certain that the AddedRecords collection contains items, Last() will work as expected, and the StartTime will be assigned to Data.
- 5 Replies
- 2 Participants
-
FP Francesco Pruneri
- Oct 15, 2024 10:53 AM UTC
- Oct 18, 2024 01:41 PM UTC