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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

custom icon toolbar with font-awesome icon

Thread ID:

Created:

Updated:

Platform:

Replies:

147485 Sep 12,2019 07:40 AM UTC Sep 13,2019 01:24 PM UTC Angular - EJ 2 1
loading
Tags: TreeGrid
Yan Duchayne
Asked On September 12, 2019 07:40 AM UTC

Hi,

Is it possible to put custom icon in angular treegrid ? I read some tutorials in the forum but all describe how to replace syncfusion icon by another syncfusion icon.

  public toolbar = ['Add''CollapseAll''ExcelExport''CsvExport''Print',
    { text: 'Tout développer'tooltipText: 'Tout développer'prefixIcon: 'fas fa-expand'id: 'ExpandAllCustom' }
  ];

when i try this code, the html source look like this : <span class="e-btn-icon fas fa-expand e-icons e-icon-left"></span>
and class fa-expend is not taking into account

thanx,
Yan

Padmavathy Kamalanathan [Syncfusion]
Replied On September 13, 2019 01:24 PM UTC

Hi Yan, 

Thanks for contacting Syncfusion Forums. 

QUERY: Custom icon toolbar with font awesome icon 
 
From your query we understand that you need to add font awesome icon to the custom toolbar option. This can be done by adding a class to the prefixIcon property of custom toolbar option and setting icon to that class. 

Please refer the below code snippet, 

In index.html 
<head> 
  <link rel='nofollow' href="//cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="icon" type="image/x-icon" rel='nofollow' href="favicon.ico"> 
</head> 

In app.component.ts 
    ngOnInit(): void { 
        this.toolbar= ['ExpandAll', 'CollapseAll',  {text: 'Quick Filter', tooltipText: 'Quick Filter', id: 'refresh', prefixIcon: 'e-test'}]; 
    } 

In app.component.css 

.e-treegrid .e-toolbar-item .e-test::before { 
  font: normal normal normal 14px/1 FontAwesome; 
  content: "\f06e"; 
} 


Please refer the below screenshot, 

 

In this way you can set font awesome icon to custom toolbar. 

Please refer the below sample, 

If you have further queries, please get back to us. 

Regards, 
Padmavathy Kamalanathan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon