- Home
- Forum
- Angular - EJ 2
- Single Dropdown Selected list with tick icon
Single Dropdown Selected list with tick icon
Hi
Attachment: screenshot2019.04.03150704.png_a7e8527c.zip
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
SIGN IN To post a reply.
3 Replies
PO
Prince Oliver
Syncfusion Team
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:
Sample Link: https://stackblitz.com/edit/angular-kkkvge
Let us know if you need any further assistance on this.
Regards,
Prince
SU
sunithra
April 4, 2019 06:35 AM UTC
Hi
Thanks and its working fine.
Regards,
Sunithra.C
PO
Prince Oliver
Syncfusion Team
April 4, 2019 06:46 AM UTC
Hello Sunithra,
Most Welcome. We are glad to help you.
Regards,
Prince
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
SU sunithra
- Apr 3, 2019 09:39 AM UTC
- Apr 4, 2019 06:46 AM UTC