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

Collapse / Expand icons

I have been asked if we can change the icons used to expand & collapse the columns & swim lanes in a kanban board. I can see that these are derived from the ej.widgets charater set.

I am hoping that someone may have done this before and can give me an example.

6 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team March 28, 2019 06:01 AM UTC

Hi Martin, 
 
We have achieved your requirement through CSS and default EJ icons, kindly refer the below links. 
 
.e-kanban .e-slcollapse:before, 
  .e-kanban .e-clcollapse:before { 
      content: "\e606"; 
    } 
    .e-kanban .e-slexpand:before, 
    .e-kanban .e-clexpand:before { 
      content: "\e607" 
    } 
 
Regards, 
Karthi 



MP Martin Pamplin March 28, 2019 09:23 AM UTC

Thanks, I have that working. The question is can I add my own icons in here somehow?


KK Karthigeyan Krishnamurthi Syncfusion Team March 29, 2019 06:10 AM UTC

Hi Martin, 
 
Yes, custom icon can be added in the same way. In the below sample, Bootstrap Glyphicon is added. 

 
<link rel="stylesheet" rel='nofollow' href="//maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">  
 
<style>  
  .e-kanban .e-slcollapse:before, 
  .e-kanban .e-clcollapse:before { 
     content: "\e030"; 
    } 
    .e-kanban .e-slexpand:before, 
    .e-kanban .e-clexpand:before { 
      content: "\e031" 
    } 
  </style> 
 
create: function (args){ 
                   var lenCl = $(".e-icon.e-clexpand").length; 
                                  for(var i=0; i<lenCl; i++) { 
                                                               icon = $(".e-icon.e-clexpand")[0]; 
                                                               icon.classList.replace("e-icon", "glyphicon"); 
                                               } 
                                               var lenSwim = $(".e-icon.e-slexpand").length; 
                                               for(var j=0; j<lenSwim; j++) { 
                                                               icon = $(".e-icon.e-slexpand")[0]; 
                                                               icon.classList.replace("e-icon", "glyphicon"); 
                                               } 
                  } 
 

Regards, 
Karthi 



MP Martin Pamplin March 29, 2019 09:30 AM UTC

Yes, but I am asking if we can create an entirely new, never seen before, icon?


HB Hareesh Balasubramanian Syncfusion Team April 1, 2019 02:02 PM UTC

Hi Martin, 
 
Yes, you can create your own font icons, for which many online tools are available to make use of. The generated icons can then be located and referenced in your application which uses ej controls, by defining its source path to the font-face as shown in the following code example. Once the font family is defined in your application, you can now replace any of the existing icon content with the newly generated content code. 
  
@font-face { 
    font-family: 'customiconpackname'; 
    src: url('../fonts/customiconpack.eot?lchn8y'); 
    src: url('../fonts/customiconpack.eot?lchn8y#iefix') format('embedded-opentype'), 
         url('../fonts/customiconpack.ttf?lchn8y') format('truetype'), 
         url('../fonts/customiconpack.woff2?lchn8y') format('woff'), 
         url('../fonts/customiconpack.woff?lchn8y') format('woff'), 
         url('../fonts/customiconpack.svg?lchn8y#customiconpack') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 
 
selector:after { 
    font-family: 'customiconpackname'; 
    content: '\e953'; 
    } 
 
Please refer the following stack over flow link which will demonstrate how to generate custom icons and use it in application 
  
Regards, 
Hareesh B


HB Hareesh Balasubramanian Syncfusion Team April 1, 2019 02:05 PM UTC

Hi Martin, 
 
Yes, you can create your own font icons, for which many online tools are available to make use of. The generated icons can then be located and referenced in your application which uses ej controls, by defining its source path to the font-face as shown in the following code example. Once the font family is defined in your application, you can now replace any of the existing icon content with the newly generated content code. 
  
@font-face { 
    font-family: 'customiconpackname'; 
    src: url('../fonts/customiconpack.eot?lchn8y'); 
    src: url('../fonts/customiconpack.eot?lchn8y#iefix') format('embedded-opentype'), 
         url('../fonts/customiconpack.ttf?lchn8y') format('truetype'), 
         url('../fonts/customiconpack.woff2?lchn8y') format('woff'), 
         url('../fonts/customiconpack.woff?lchn8y') format('woff'), 
         url('../fonts/customiconpack.svg?lchn8y#customiconpack') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 
 
selector:after { 
    font-family: 'customiconpackname'; 
    content: '\e953'; 
    } 
 
Please refer the following stack over flow link which will demonstrate how to generate custom icons and use it in application 
  
Regards, 
Hareesh B

Loader.
Live Chat Icon For mobile
Up arrow icon