disable attendee dropdown list in Kendo UI Scheduler

1 Answer 69 Views
Scheduler
Pankaj
Top achievements
Rank 1
Iron
Iron
Pankaj asked on 07 Jun 2023, 09:10 AM

Hi

I have a Requirement where only one attendee is allowed to schedule his appointments , there are many attendee exists. so I want to show only one attendee in dropdown list and I have populated with single attendee in dropdown list but after that create event is not working in Scheduler. please help me to sort out this issue or please provide me option so that I can disable attendee dropdown list. 

Thanks & Regards

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 12 Jun 2023, 07:12 AM

Hello Pankaj,

You can disable the attendees dropdownlist/multiselect by handling the edit event of the Scheduler. In the event hanlder you can get a reference to the needed component and disable it as in the example below:

edit: function(e){
          $(e.container).find('.k-multiselect select').data('kendoMultiSelect').enable(false)
},

Here is a Dojo example where the above is demonstrated.

Regarding the issue when setting a single item in the DropDownList, could you please provide us with more details on the exact implementation? This way we could get a better idea of what might be the cause of the issue and advise you further.

Regards,
Neli
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 14 Jun 2023, 05:01 PM

Hi Neli

Thanks for your response.

This solution is working fine but problem is that I have two dropdown list (attendee and title) on this popup window. I have converted title text box to dropdown list by using this code:- 


edit: function (e) { //find the title element and create a DropDownList bound to the all event titles e.container.find("[name=title]").removeClass("k-input").kendoDropDownList({ dataTextField: "LeaveTypeName", dataValueField: "LeaveTypeName", dataSource: new kendo.data.DataSource({ transport: { read: function (e) { //alert('Read Event Fire');//console.log(eventList); e.success(List); } } }) }) },

solution provied by you disabled my both dropdown list. I want to only disable my attendee dropdown list.

Regards

 


Neli
Telerik team
commented on 19 Jun 2023, 09:49 AM

Hi Pankaj,

The approach of using the name attribute to distinguish the needed DropDownList is correct. You can use the name or title attributes to find the component and disable it as in the example below:

$(e.container).find('select[title="Evaluations"]').data('kendoDropDownList').enable(false)

In the snippet provided in your reply I am not sure about the purpose of removing the 'k-input' class. Could you please elaborate a little bit on that?

Looking forward to your reply.

Regards,

Neli

Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 19 Jun 2023, 03:52 PM

Hi Neli, Thanks for your kind response.

I am using the two Scheduler view one for setting the employee schedule and another for booking client appointments. In This I am using the Title dropdown for option like vacation, breaktime, sick etc. so that employees can set their availability.

please tell me how can I set 'Attendees' dropdown name or title because its changed every time according to Title field value. 

Regards

Pankaj

Neli
Telerik team
commented on 22 Jun 2023, 07:46 AM

Hi Pankaj, 

If you need to set the title of the Attendees dropdownlist you can use the resources.title option

- https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/configuration/resources#resourcestitle

 

 {
              field: "attendees",
              name: "Test",
              dataSource: [
                { text: "Alex", value: 1 },
                { text: "Bob", value: 2 },
                { text: "Charlie", value: 3 }
              ],
              multiple: false,
              title: "My custom title"
            }

 

Here you will find the modified example. 

Regards,

Neli

Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 22 Jun 2023, 08:39 AM | edited

Hi Neli

Here I am talking about attendee dropdown Select tag title. By default this is inherited from Title field value please refer to this Screenshot(PFA the same) 

Regards

Pankaj

Neli
Telerik team
commented on 27 Jun 2023, 06:41 AM

Hi Pankaj,

If you need to change the content of the attributes, in the edit event hanlder, you can find the needed select element and try using the jQuey attr() method:

$('select:eq(2)').attr('title', 'Changed title')

The above is demonstrated in the Dojo linked here.

I hope this helps.

Regards,

Neli

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