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

Single Dropdown Selected list with tick icon

Hi

In Single Selected Dropdown list i need tick icon for the selected item.

Have Attached the screenshot of the requirement below.Thanks In Advance.


Regards,

Sunithra.C

Attachment: screenshot2019.04.03150704.png_a7e8527c.zip

3 Replies

PO Prince Oliver Syncfusion Team April 3, 2019 10:25 PM

Hello Sunithra, 

Greetings from Syncfusion support. 

To enable tick icon for selected item in a DropDownList, you need to use the iconCss field to add the icon to the popup list. Since the icon needs to be displayed for selected item. We need to customize the existing behavior for the selected item by overriding the default styles using cssClass property. The icon is added only to the active item in the list. Kindly refer to the following code snippet. 

<style> 
    .e-active-tick .e-dropdownbase .e-list-item.e-active .e-list-icon { 
        font-family: 'e-icons'; 
        color: rgba(0, 0, 0, .57); 
        font-size: 33px; 
        padding: 0px; 
    } 
    .e-active-tick .e-list-item.e-active { 
        text-indent: 0px; 
    } 
    .e-active-tick .e-list-item.e-active .tick:before { 
        content: '\e259' 
    } 
    .e-active-tick .e-dropdownbase .e-list-item.e-active { 
        background: #fff; 
        color: #333; 
        border-color: #fff; 
    } 
    .e-active-tick .e-dropdownbase .e-list-item.e-active.e-hover { 
        background-color: #f5f5f5; 
        border-color: #fff; 
        color: #333; 
    } 
</style> 
  
<ejs-dropdownlist id='games' #sample1 [dataSource]='sportsData' [cssClass]='customClass' [fields]='localFields' [placeholder]='localWaterMark' [popupHeight]='height'></ejs-dropdownlist> 

public localFields: Object = { text: 'Game', value: 'Id', iconCss: 'Class' };  
public customClass: string = 'e-active-tick'; 

We have attached the sample for your reference, please find the sample at the following location: 

Let us know if you need any further assistance on this. 

Regards, 
Prince 



SU sunithra April 3, 2019 10:35 PM

Hi

Thanks and its working fine. 


Regards,

Sunithra.C


PO Prince Oliver Syncfusion Team April 3, 2019 10:46 PM

Hello Sunithra, 

Most Welcome. We are glad to help you. 

Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon