highlight a particular attendee with a red border in the dropdown list | Kendo Scheduler

1 Answer 55 Views
Scheduler
Pankaj
Top achievements
Rank 1
Iron
Iron
Pankaj asked on 26 Sep 2024, 05:44 PM | edited on 26 Sep 2024, 05:49 PM

Hi,

I have a requirement to highlight a particular attendee with a red border in the dropdown list. The idea is to indicate that this attendee is not available at that specific date and time when someone opens the appointment pop-up (refer to the attachment). I know color option is there but i want to add red border to particular attendee. there can be situation where red border can be added to more then one attendee. Please help me understand how I can achieve this.

Thanks!

Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 01 Oct 2024, 09:21 AM

Hello ,

Telerik support team request you to please provide a workaround for this. 

Regards

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 01 Oct 2024, 10:30 AM

Hello, Pankaj,

A possible approach would be to use the edit event to find the DropDownList component in the edit popup. You can then bind to the DropDownList's open event, and use the API to search for the specific item on which you wish to apply custom styles:

 edit: function(){
            var ddl = $("[data-container-for='ownerId']").children().find("select").data("kendoDropDownList")
            ddl.bind("open", function(e){
              var items = e.sender.dataSource.data();
              for(let item of items){ 
                if(item.text === "Alex"){
                  $(`.k-list-item-text>span:contains(${item.text})`).parent().closest("li").css('background-color', 'yellow');
                }
              }
            })
          },

Here you will find a small example for reference.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Scheduler
Asked by
Pankaj
Top achievements
Rank 1
Iron
Iron
Answers by
Martin
Telerik team
Share this question
or