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

How to trigger change event without having to configure asyncSettings

Hi Syncfusion Team,
I'm using UploaderComponent but it seems like the change event doesn't be triggered when I upload a file or remove it. I've checked and realized that it's only triggered when after I configured asyncSettings props. Is there any way to use the change event without having to configure asyncSettings?

Thanks,
Hung


1 Reply

UD UdhayaKumar Duraisamy Syncfusion Team December 9, 2022 06:48 AM UTC

You can try selected event and removing event from the uploader component. The selected event triggers after selecting or dropping the files by adding the files in upload queue. while removing the selected file the removing event will be triggered.


Documentation :



export class Default extends SampleBase {

 

  onChange(args) {

    console.log(args);

  }

 

  onRemoving(args) {

    console.log(args);

  }

  render() {

    return (

      <div className="col-lg-9">

        <div className="upload_wrapper">

          {/* Render Uploader */}

          <UploaderComponent

            id="fileUpload"

            type="file"

            selected={this.onChange.bind(this)}

            removing={this.onRemoving.bind(this)}

          ></UploaderComponent>

        </div>

      </div>

    );

  }

}

 


Sample : https://stackblitz.com/edit/react-mt9nfq?file=index.js


Loader.
Live Chat Icon For mobile
Up arrow icon