【问题标题】:Kendo Dropdown closes when we click to open it in IE browser当我们在 IE 浏览器中单击打开它时,Kendo Dropdown 会关闭
【发布时间】:2018-08-30 09:52:14
【问题描述】:

我在我的页面中使用 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>

【问题讨论】:

  • 我认为您的定义开头有一个额外的“#”?
  • 不,这与此问题无关,因为它适用于 chrome,好的,我将删除它以避免混淆。
  • 我已经为您准备了一个道场:dojo.telerik.com/iqosIzAw 显然我无法访问您实际用于数据集的 url,但已经模拟了我认为您期望从ds 变量中的服务器。这对你有用吗?
  • 不幸的是,当我将上面的示例粘贴到我的代码中时,它似乎不起作用....b/w 我的页面是一个引导模式弹出窗口。
  • 我使用的是 IE11。

标签: kendo-ui kendo-dropdown


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    这似乎是过滤器的问题。删除过滤器为我解决了这个问题。

    var dropdown = $("#company").kendoDropDownList({
        dataTextField: "name",
        dataValueField: "id",
        // filter: 'contains',
        optionLabel: 'Select a Company',
        enable: true,
        ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-10
      • 1970-01-01
      • 2011-10-11
      • 2011-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多