KendoMultiSelect会自动关闭鼠标输出的下拉列表

时间:2015-08-18 09:17:03

标签: jquery kendo-ui kendo-multiselect

我在ASP.NET网络表单项目中使用了KendoMultiselect控件。当鼠标离开下拉选项区域时,我希望关闭其动态下拉列表。我已经尝试了许多选项,例如下面的评论。

以下是代码段。

<select id="selInvestors" multiple="multiple" data-placeholder=""></select>

<script language='javascript'>
var myJsonObj = [{text: "Client", val: "4" },{text: "Employees", val: "16" },{text: "Other", val: "32" }];

       $(function () {
                $("#selInvestors").kendoMultiSelect({
                    dataTextField: "text",
                    dataValueField: "val",
                    dataSource: myJsonObj
                });

                var selinvCtl = $("#selInvestors").data("kendoMultiSelect");
                $('#selInvestors').parent().css({ "width": "355" });

                 //The below statement is even executing when i hover over the dropdown options. I dont know why ?  I want to close the downdown, whenever the mouse cursor goes out of the dropdown control.

                $("ul[id*='selInvestors']").mouseout(function () { console.log('I am out'); /*selinvCtl.close();*/ });
     });

    </script>

请建议。

1 个答案:

答案 0 :(得分:1)

尝试.mouseleave()而不是.mouseout()

see example