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

Error after upgrading to latest version

4 Answers 213 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Stefano
Top achievements
Rank 1
Stefano asked on 18 Jan 2016, 08:06 PM

Hello,

After upgrading to lastest version (2016Q1) the dropdownlists in my application using custimized templates stopped working with the following error: The 'optionLabel' option is not valid due to missing fields.

my code is similar to:

$("#mylist").kendoDropDownList({
    optionLabel: "Select ...",
    autoBind: true,
    dataSource: recordDataSource,
    dataTextField: "recordId",
    dataValueField: "recordId",
    filter : "contains",
    template: '#: firstName # #: lastName #',
    valueTemplate: '#: firstName # #: lastName #'
});

Datasoruce is made by 3 columns recordId, firstName, lastName


4 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 20 Jan 2016, 09:10 AM
Hello Stefano,

I have tested our online demos and everything is working fine. Could you please setup a runnable sample in dojo and send it for a local test. 

Regards,
Peter Filipov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ryan
Top achievements
Rank 1
answered on 25 Jan 2016, 05:53 PM
We had this issue as well after the new version.  The problem comes with using valueTemplate and optionLabel together in a dropDownList (even though this wasn't the case before the new version)--Kendo tries to render a valueTemplate for optionLabel, which causes the problem.

I fixed this by passing the necessary attributes to the optionLabel attribute:

kendoDropDownList: {                
    dataTextField: 'icd9Code',
    dataValueField: 'id',
    optionLabel: {
        id: null,
        icd9Code: app.message('hems.selector.general.none_selected'),
        description: app.message('hems.selector.general.none_selected')
    },
    valueTemplate: '#= data.icd9Code # - #= description #',
    template: '#= data.icd9Code # - #= description #'            
}

0
Bob
Top achievements
Rank 1
answered on 01 Feb 2016, 01:37 PM

 I'm also getting this error after upgrading Kendo this week. I'm using the Angular directives.  

<select kendo-drop-down-list
k-ng-model="vm.contactId"
k-value-primitive="true"
k-data-value-field="'id'"
k-data-source="vm.contacts"
k-option-label="'Select a Contact'"
k-template="'#=firstName# #=lastName#'"
k-value-template="'#=firstName# #=lastName#'"
class="w-full"></select>

0
Bob
Top achievements
Rank 1
answered on 02 Feb 2016, 03:43 PM
I was able to resolve my issue by using k-option-label-template  (instead of k-option-label) in cases where I have a value-templates defined
Tags
DropDownList
Asked by
Stefano
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Ryan
Top achievements
Rank 1
Bob
Top achievements
Rank 1
Share this question
or