Referencing the active Event

Hi,

We are using ScheduleTemplates and EditorTemplate to create the Event below.  We want to calculate the Billing Rate based on the Case/Stage/BookingType dropdown values - how can we do this?

We have captured the event when BookingType is selected but how do we reference the active Event?




7 Replies

AK Alagumeena Kalaiselvan Syncfusion Team March 30, 2020 12:43 PM UTC

Hi Alex, 

Thanks for contacting Syncfusion support! 

We have validated your reported query “Referencing the active event” and you can calculate the Billing Rate based on the preferred provided input values by using Scheduler OnActionBegin Event. Refer the below UG link for the event details 


Kindly get back to us, If you need further assistance. 

Regards 
Alagumeena.K 



AL Alex March 30, 2020 02:02 PM UTC

Thanks for the response.

I need to be able to calculate the billing rate only when I've selected BookingType, not editing or creating the Event - will this work?  OnActionBegin event suggests this will too early?


AK Alagumeena Kalaiselvan Syncfusion Team March 31, 2020 02:15 PM UTC

Hi Alex, 
  
Thanks for your update! 
  
You can calculate the billing rate based on the selected Booking type by assigning the EjsDropdownList component value to the EjsNumericTextbox. Refer the below code for that. 
  
@using Syncfusion.Blazor.DropDowns 
@using Syncfusion.Blazor.Inputs 
  
<SfNumericTextBox TValue="int?" Value="@NumericValue"></SfNumericTextBox> 
  
<SfDropDownList TValue="int?" Placeholder="Select Booking Type" TItem="Type" Value="@DropVal" DataSource="@BookingType"> 
    <DropDownListEvents TValue="int?" ValueChange="onChange"></DropDownListEvents> 
    <DropDownListFieldSettings Value="Rate" Text="Name"></DropDownListFieldSettings> 
</SfDropDownList> 
  
@code { 
    public int? NumericValue { get; set; } 
    public int? DropVal; 
  
    public class Type 
    { 
        public string Name { get; set; } 
        public int? Rate { get; set; } 
    } 
  
    List<Type> BookingType = new List<Type> 
{ 
        new Type() { Name = "BookingType1", Rate = 180 }, 
        new Type() { Name = "BookingType2", Rate = 200 }, 
        new Type() { Name = "BookingType3", Rate = 250 } 
    }; 
    private void onChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs<int?> args) // It triggers whenever we selecting the value from dropdownlist 
    { 
        DropVal = args.Value;  // To get the value for based on the BookingType 
        NumericValue = DropVal;  // Map the Rate value to NumericTextbox  
        StateHasChanged(); 
    } 
} 
  
  
Please try out with shared solution and let us know, If you have any further assistance. 
  
Regards 
Alagumeena.K 



AL Alex April 3, 2020 03:34 PM UTC

Thanks for the reply, but will this work as part of the Editor Template?  I need to update a property of the current Entry selected not a stand alone property.  How do I reference the current Event?


AK Alagumeena Kalaiselvan Syncfusion Team April 7, 2020 01:31 PM UTC

Hi Alex, 
  
Yes,  the shared code will work as part of the Scheduler EditorTemplate. We have integrated your requirement inside the EditorTemplate for your reference. Refer the below sample link for that 
  
Kindly try out with shared sample and get back to us, If you need further assistance. 
  
Regards 
Alagumeena.K 



AL Alex April 7, 2020 04:45 PM UTC

Thanks!


VM Vengatesh Maniraj Syncfusion Team April 8, 2020 04:52 AM UTC

Hi Alex, 

You are most welcome. 

Please get in touch with us if you need any further assistance. 

Regards, 
Vengatesh 


Loader.
Up arrow icon