Error after upgrading to latest version

5 posts, 0 answers
  1. Stefano
    Stefano avatar
    3 posts
    Member since:
    Jan 2015

    Posted 18 Jan Link to this post

    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


  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 20 Jan Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Ryan
    Ryan avatar
    7 posts
    Member since:
    Jan 2016

    Posted 25 Jan in reply to Stefano Link to this post

    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 #'            
    }

  5. Bob
    Bob avatar
    3 posts
    Member since:
    Feb 2014

    Posted 01 Feb in reply to Peter Filipov Link to this post

     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>

  6. Bob
    Bob avatar
    3 posts
    Member since:
    Feb 2014

    Posted 02 Feb in reply to Bob Link to this post

    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
Back to Top
Kendo UI is VS 2017 Ready