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

toolbarClick event does not trigger when a toolbar SortBy child menu item is chosen.

On my <ejs-filemanager> instantiation in Angular, I apply the (toolbarClick)="onToolbarClick($event)"​ directive. The file manager triggers the onToolbarClick​ method when the user clicks an item on the toolbar. However, it does not trigger when the user clicks an item in a child menu, such as "SortBy". How can I trigger an event when the user chooses a SortBy submenu option? Thank yoU



1 Reply

IL Indhumathy Loganathan Syncfusion Team March 29, 2023 02:10 PM UTC

Hi Matthew,


Greetings from Syncfusion support.


We don't have a direct event to identify the SortBy subitem click. But you can use the SortBy dropdown instance to trigger its select event. We have used the File Manager created event to trigger this event. Check out the below code snippet.


  created() {

    //sortby item's id will be FileManager's id_Toolbar's id_sortby

    var ddbObj = (document.getElementById('overview_tb_sortby') as any)

      .ej2_instances[0];

    //select event will be triggered on item click.

    ddbObj.select = function (args) {

      console.log(args);

    };

  }


Sample: https://stackblitz.com/edit/angular-92e5om?file=src%2Fapp.component.html,src%2Fapp.component.ts


Check out the shared sample and get back to us if you need any further assistance.


Regards,

Indhumathy L


Loader.
Live Chat Icon For mobile
Up arrow icon