首页 > 解决方案 > 当我们在 IE 浏览器中单击打开它时,Kendo Dropdown 会关闭

问题描述

我在我的页面中使用 Kendo UI v2018.1.221,每当我单击下拉菜单打开它时,它只会打开并显示选项并在我做出选择之前突然关闭。它也使用服务器过滤。我用谷歌搜索了很多,但没有找到任何解决方案。示例代码:

 <table>
<TR>
    <TD ALIGN="left" >Company:</TD>
    <TD ALIGN="left" >
        <select class="form-control" style="width: 80%" name="teamID" id="company">

        </select>
   </TD>
</TR>

<script>
var dropdown = $("#company").kendoDropDownList({
            dataTextField: "name",
            dataValueField: "id",
            filter: 'contains',
            optionLabel: 'Select a Company',
            enable: true,
            scrollable: {
                virtual: true
            },
            virtual: {
                itemHeight: 26
            },
            dataSource: {
                type: "odata",
                transport: {
                    read: {
                        dataType: "json",
                        url: "#url#"
                    }
                },
                batch: true,
                pageSize: 80,
                serverPaging: true,
                serverFiltering: true,
                schema: {
                    data: "data",
                    total: 'recordsTotal',
                    model: {
                        id: 'teamid',
                        fields: {
                            id: {
                                type: 'number'
                            },
                            name: {
                                type: 'string'
                            }
                        }
                    }
                }
            }

        }).data("kendoDropDownList");
</script>

标签: kendo-uikendo-dropdown

解决方案


您需要将焦点从模态中移开。您可以在公开活动中执行此操作。

  open: function(e) {
     $(document).off('focusin.bs.modal');
  }

推荐阅读