Change selected value of kendo ui dropdownlist

后端 未结 5 961
忘掉有多难
忘掉有多难 2020-12-28 13:18

I have a kendo ui dropdownlist in my view:

$(\"#Instrument\").kendoDropDownList({
    dataTextField: \"symbol\",
    dataValueField: \"symbol\",
    dataSour         


        
5条回答
  •  时光说笑
    2020-12-28 13:28

    Seems there's an easier way, at least in Kendo UI v2015.2.624:

    $('#myDropDownSelector').data('kendoDropDownList').search('Text value to find');
    

    If there's not a match in the dropdown, Kendo appears to set the dropdown to an unselected value, which makes sense.


    I couldn't get @Gang's answer to work, but if you swap his value with search, as above, we're golden.

提交回复
热议问题