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

Single Dropdown Selected list with tick icon

Thread ID:

Created:

Updated:

Platform:

Replies:

143737 Apr 3,2019 09:39 AM UTC Apr 4,2019 06:46 AM UTC Angular - EJ 2 3
loading
Tags: DropDownList
sunithra
Asked On April 3, 2019 09:39 AM UTC

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

Prince Oliver [Syncfusion]
Replied On April 4, 2019 06:25 AM UTC

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 


sunithra
Replied On April 4, 2019 06:35 AM UTC

Hi

Thanks and its working fine. 


Regards,

Sunithra.C

Prince Oliver [Syncfusion]
Replied On April 4, 2019 06:46 AM UTC

Hello Sunithra, 

Most Welcome. We are glad to help you. 

Regards, 
Prince 


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