如何在剑道组合框中更改/设置值

How to change/set value in kendo combobox

本文关键字:设置 组合      更新时间:2023-09-26

谁能告诉我如何动态更改剑道组合框的值。

小提琴在这里 - http://jsfiddle.net/ashwyn/yL6w3/1/

在上面的小提琴中,当我们单击click时,显示的值应更改为three(例如。

我找到了这个链接,其中列出了所有数据源方法 -
http://www.kendoui.com/documentation/framework/datasource/methods.aspx

如果你知道你想要的值,你也可以做:

$("#MyComboBox").data("kendoComboBox").value(id);

工作演示 http://jsfiddle.net/Bxsge/2/或 http://jsfiddle.net/Bxsge/1/(当您单击选择的链接时,演示的行为将更改为three所选值。

通过 jQuery 对象// selects by index combobox.select(1); // selects item选择

链接: http://www.kendoui.com/documentation/ui-widgets/combobox/methods.aspx

希望这有帮助,:)

法典

$(function(){
    var CB = $("select").kendoComboBox();
  
    $("a").click(function(){
        
         var $cbx = $("select").data("kendoComboBox")
         
         $cbx.select(2);
       
    });
});
​