Events in Floating Action Button Control

31 Oct 20221 minute to read

This section explains the available events in Floating Action Button Control.

Created

Event triggers after the creation of Floating Action Button.

@using Syncfusion.EJ2.Buttons

@Html.EJS().Fab("fab").Created("CreatedEvent()").IconCss("e-icons e-edit").Content("Edit").Render()

<script>

    function CreatedEvent() {
        // Your required action here
    }

</script>
public ActionResult CreatedEvent()
{
    return View();
}

OnClick

Event triggers when the Floating Action Button is clicked. Below example shows the Click event of the Floating Action Button.

@using Syncfusion.EJ2.Buttons

@Html.EJS().Fab("fab").IconCss("e-icons e-edit").Content("Edit").Render()

<script>

    document.getElementById("fab").addEventListener('click', function () {
        alert("Edit is clicked!");
    });

</script>
public ActionResult OnClickEvent()
{
    return View();
}