【问题标题】:$("#myKendoGrid").data("kendoGrid") is undefined after opening (and closing) jQuery UI dlg$("#myKendoGrid").data("kendoGrid") 在打开(和关闭)jQuery UI dlg 后未定义
【发布时间】:2016-01-15 19:06:19
【问题描述】:

我遇到了一个奇怪的问题。 打开(和关闭)一个 jQuery UI 模态对话框后,调用对话框的页面上的 kendo UI 网格 .data 即 var grd = $("#myGrid").data("kendoGrid") 变得未定义。 在打开(和关闭)对话框之前,剑道网格工作得很好。 然而,剑道网格会显示打开(和关闭)对话框之前的数据。 .data 在页面刷新后开始工作。

这样做是否有任何已知问题,或者我在这里遗漏了什么?

jQuery 版本 - 1.7.1 jQuery UI 版本 - 1.8.11 剑道 UI 版本 - v2011.3.1129

jQuery UI 对话框代码:

$(function () {
    $("#dialog").dialog({
        autoOpen: false,
        modal: true,
        width: 600,
        height: 300,
        buttons: {
            "Dismiss": function () {
                debugger;
                $(this).dialog("close");
            }
        }
    });


$(".openDialog").live("click", function (e) {
    debugger;
    e.preventDefault();
    $("#dialog").html("");
    $("#dialog").dialog({
        title: $(this).attr("abc"),
        //close: function () { debugger; return false; },
        modal: true,
        height: 800,
        width: 1150,
        left: 0
    }).load(this.href);
});

剑道网格代码:

$("#myGrid").html("");
$("#myGrid").kendoGrid({
    dataSource: ds
            , sortable: true
            , selectable: true
            , scrollable: true
            , height: 400
            , columns: [
            , {title: "Auto", template: '#=myFunc(xyz)#', width: myWidth }

.....

【问题讨论】:

    标签: javascript jquery jquery-ui dialog kendo-grid


    【解决方案1】:

    我们最终通过从 jQuery UI 对话框切换到 Kendo 窗口解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2013-08-13
      • 2013-06-08
      • 2010-09-26
      • 1970-01-01
      • 2013-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多