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. Image for the cookie policy date
close icon

button events does not fire

<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
                    <EjsButton @ref="ToggleBtn" @onmouseover="@onToggleClick" CssClass="e-flat" IsToggle="true" IsPrimary="true" >sdddsdsds</EjsButton>

                </div>
code {
 EjsButton ToggleBtn;
    public string Content = "Play";
    private void onToggleClick(UIMouseEventArgs args)
    {
        if (ToggleBtn.Content == "Play")
        {
            this.Content = "Pause";
        }
        else
        {
            this.Content = "Play";
        }
    }
}

3 Replies

SP Sangeetha Priya Murugan Syncfusion Team July 30, 2019 07:17 AM UTC

Hi Ebi, 
 
Thank you for contacting syncfusion support. 
 
We have checked your reported issue and the button’s mouseover event triggered properly in our end. Based on your provided code you have tried to change the content property of the button, but you haven’t bind that property initially. So we would suggest you to bind the content property initially as like as in the below code example. 
 
CODE SNIPPETS: 
 
 
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6"> 
    <EjsButton @ref="ToggleBtn" @onmouseover="@onToggleClick" CssClass="e-flat" IsToggle="true" IsPrimary="true" Content="@Content"></EjsButton> 
 
</div> 
 
@code { 
 EjsButton ToggleBtn; 
    public string Content = "Play"; 
    private void onToggleClick(UIMouseEventArgs args) 
    { 
        if (ToggleBtn.Content == "Play") 
        { 
            this.Content = "Pause"; 
        } 
        else 
        { 
            this.Content = "Play"; 
        } 
    } 
} 
 
For your convenience, we have prepared the sample based on your requirement. Please find the link below. 
 
 
Could you please check the above sample and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 




ET ebi torabi July 31, 2019 06:12 PM UTC

Hi Sangeetha 
please see attached video
Unfortunately, despite the above changes, the problem was not resolved
@page "/AllergiesPage"
@inject HttpClient http

<EjsButton @ref="ToggleBtn" @onclick="@onToggleClick" CssClass="e-flat" IsToggle="true" IsPrimary="true" Content="@Content"></EjsButton>

<EjsGrid id="Grid" @ref="@grid" EnableRtl="true" AllowFiltering="true" AllowResizing="true" AllowSorting="true" AllowTextWrap="true" ShowColumnChooser="true" ShowColumnMenu="true" GridLines="@GridLine.Both" Height="100%" AllowGrouping="true" AllowPaging="true" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
        <EjsDataManager Adaptor="Adaptors.WebApiAdaptor" Url="api/Allergies" CrossDomain="true"></EjsDataManager>
        <GridFilterSettings Type="@Syncfusion.EJ2.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
        <EjsPager PageSize="12"></EjsPager>
        <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
        <GridColumns>
            <GridColumn Field=@nameof(Allergies.AllergyId) HeaderText="AllergyId" TextAlign="@TextAlign.Center" IsPrimaryKey="true" IsIdentity="true"></GridColumn>
            <GridColumn Field=@nameof(Allergies.AllergyName) HeaderText="AllergyName" TextAlign="@TextAlign.Center" ValidationRules="@(new { required= true })"></GridColumn>

            <GridColumn Field=@nameof(Allergies.AllergyCategoryId) HeaderText="AllergyCategoryId" TextAlign="@TextAlign.Center" ValidationRules="@(new { required= true  })" ForeignKeyField="Id" ForeignKeyValue="Name"
                        DataSource="@(new Syncfusion.EJ2.Blazor.DataManager(){ Url = "api/AllergyCategories/GetNameId", Adaptor= Syncfusion.EJ2.Blazor.Adaptors.WebApiAdaptor })"></GridColumn>
            <GridColumn Field=@nameof(Allergies.Description) HeaderText="Description" TextAlign="@TextAlign.Center" ValidationRules="@(new { required= true })"></GridColumn>

        </GridColumns>
    </EjsGrid>


@code{
    EjsGrid grid;
    EjsButton ToggleBtn;
    public string Content = "Play";
    private void onToggleClick(UIMouseEventArgs args)
    {
        if (ToggleBtn.Content == "Play")
        {
            this.Content = "Pause";
        }
        else
        {
            this.Content = "Play";
        }
    }
}

visual stadio 2019 preveiw 7
blazor hosted core

Attachment: button_1898a6b7.rar


SP Sangeetha Priya Murugan Syncfusion Team August 1, 2019 12:30 PM UTC

Hi Ebi, 
 
Thank you for your update. 
 
We have created the new support ticket #243904 for this issue. Please check on this for further clarification. 
 
Regards, 
Sangeetha M 


Loader.
Live Chat Icon For mobile
Up arrow icon