Trace events of progress button in EJ2 TypeScript Progress button control

10 May 20235 minutes to read

The ProgressButton component triggers events based on its actions. The events can be used as extension points to perform custom operations.

The events available in ProgressButton are fail, begin, progress, and end.

import { Button } from '@syncfusion/ej2-buttons';
import { ProgressButton, ProgressEventArgs } from '@syncfusion/ej2-splitbuttons';

let progressBtn: ProgressButton = new ProgressButton({
    content: 'Progress',
    enableProgress: true,
    begin: (args: ProgressEventArgs) => {
    end: (args: ProgressEventArgs) => {
    progress: (args: ProgressEventArgs) => {
    fail: (args: Event) => {
    }, '#progressbtn');

let clear: Button = new Button({ cssClass: 'e-small'});

clear.element.onclick = () => {
    let propertyElem: HTMLElement = document.getElementById('propertyTable');
    propertyElem.getElementsByTagName('td')[0].innerHTML = '';

function updateEventLog(args: any): void {
    let propertyElem: HTMLElement = document.getElementById('propertyTable');
    propertyElem.getElementsByTagName('td')[0].insertAdjacentHTML('beforeend', + ' Event triggered. <br />');
<!DOCTYPE html>
<html lang="en">

    <title>EJ2 ProgressButton</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="This sample is to customize progress indicator with top, reverse and vertical in the progress button" />
    <meta name="author" content="Syncfusion" />
    <link href="" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <link href="styles.css" rel="stylesheet" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>
<script src="" type ="text/javascript"></script>

    <div id='loader'>LOADING....</div>
    <div id='container'>
        <div class="control-section">
            <div class="progress-btn-section">
                <button id='progressbtn'></button>
            <div class="property-section">
                <table id="propertyTable" title="Event trace">
                        <th>Event trace:-</th>
            <button id='clear'>Clear</button>

html, body, .control-section {
    height: 95%;

.progress-btn-section {
    text-align: center;
    float: left;

.property-section {
    overflow: auto;
    width: 40%;
    height: 330px;
    float: right;
    font-family: monospace;

.property-section th {
    text-align: left;

#clear {
    float: right;
    clear: both;