Add custom toolbar

Hi, have a nice day! I created a new toolbar item, but it doesn't show the icon i added. Can you help me?



3 Replies

RR Rajapandi Ravi Syncfusion Team August 16, 2021 10:58 AM UTC

Hi Toan, 

Greetings from syncfusion support 

From your update, we could see that you like to use the Custom toolbar items and also like to display the Toolbar icon. Actions for this customized toolbar items are defined in the toolbarClick event, and you can display the icon by defining the respective CSS content. Please refer the below code example, sample and documentation for more information. 

App.component.ts 
 
toolbarClick(args) { 
      if (args.item.id === 'excelexport') { 
            this.normalgrid.excelExport(); 
        } 
    } 
 
public ngOnInit(): void { 
        this.data = orderDataSource; 
        this.toolbar = [{ text: 'Export the Excel File', tooltipText: 'Export Excel', prefixIcon: 'e-Excel_Export', id: 'excelexport' }]; 
    } 
 

Index.html 
 
<Style> 
    .e-Excel_Export:before { 
      content: "\e242";    
    } 
  </style> 
 


You can use custom icons as you want by defining the respective CSS content. Please refer the below documentation for more information.  



Regards, 
Rajapandi R 



TB Toan Bui August 17, 2021 03:51 AM UTC

I did it. Thank you so much!



RR Rajapandi Ravi Syncfusion Team August 17, 2021 05:27 AM UTC

Hi Toan, 

Thanks for the update. 

We are happy to hear that your problem has been resolved. 

Please get back to us if you need further assistance. 

Regards, 
Rajapandi R 


Loader.
Up arrow icon