This is a migrated thread and some comments may be shown as answers.

Remove option 'none' from resource

3 Answers 79 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Oad
Top achievements
Rank 1
Oad asked on 26 Aug 2015, 03:31 PM

Hello,

how do I make it so that I can't choose the option 'none' from a resource in the scheduler?

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 28 Aug 2015, 08:53 AM

Hello Oad,

 

The 'none' option is set as option label for the DropDownList in order to have the event model a default value for the resourceId field (when create a new event).

 

My suggestion in this case would be using the custom editor template.  The editor template of the Scheduler can be defined manually using the template option. Here is a code library which shows how to define a custom editor template. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Oad
Top achievements
Rank 1
answered on 31 Aug 2015, 09:11 AM

Ok. Sounds fair.

Have you got any examples that use plain JS or perhaps PHP? I'm having a bit of a problem translating the template to something I can use.

 I also noticed when I tried to make my own multiselect, that I couldn't set the initial values. Do I need to do anything special to have the values from the model preselected in the template?

 

Thanks

0
Boyan Dimitrov
Telerik team
answered on 02 Sep 2015, 07:38 AM

Hello Oad,

The code library that I sent you in my last response shows how to define Kendo UI Scheduler (JavaScript) with custom editor template. No MVC wrappers are used in the project. 

Also in the example a Kendo UI MultiSelect widget is used in order to select attendees for the current event. The widget's value is bound to Attendees model field. It preselects the selected Attendees for the event and also and change the model field by using: 

<select id="Attendees" multiple="multiple" name="Attendees"
           data-role="multiselect"
           data-bind="value:Attendees"
           data-source='[{"text":"Alex","value":1},{"text":"Bob","value":2},{"text":"Charlie","value":3}]'
           data-text-field="text"
           data-value-field="value"
           data-value-primitive="true"
           ></select>

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Oad
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Oad
Top achievements
Rank 1
Share this question
or