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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

button events does not fire

Thread ID:

Created:

Updated:

Platform:

Replies:

146286 Jul 29,2019 09:14 PM UTC Aug 1,2019 12:30 PM UTC Blazor 3
loading
Tags: Button
ebi torabi
Asked On July 29, 2019 09:14 PM UTC

<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";
        }
    }
}

Sangeetha Priya Murugan [Syncfusion]
Replied On 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 



ebi torabi
Replied On 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

Sangeetha Priya Murugan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon