Jquery kendoGrid编辑弹出窗口中的可编辑kendoGrid无法正常工作

Jquery kendoGrid编辑弹出窗口中的可编辑kendoGrid无法正常工作,jquery,kendo-grid,Jquery,Kendo Grid,这是我的第一篇帖子,请对我好一点 我的问题如下: 首先,我有两个关联的实体和地址(关联的实体有许多地址) 该网页有一个可编辑的kendoGrid,其中列出了相关的地址(数据源包含所有相关的地址,每个地址都有一个地址列表),当我单击编辑按钮时,会出现一个带有数据的弹出窗口和一个带有地址列表的可编辑kendoGrid。我点击编辑按钮,编辑地址弹出窗口出现,但更新按钮不工作,取消按钮删除行 下面是我的代码 数据源 associatedDS = new kendo.data.DataSource({

这是我的第一篇帖子,请对我好一点

我的问题如下: 首先,我有两个关联的实体和地址(关联的实体有许多地址)

该网页有一个可编辑的kendoGrid,其中列出了相关的地址(数据源包含所有相关的地址,每个地址都有一个地址列表),当我单击编辑按钮时,会出现一个带有数据的弹出窗口和一个带有地址列表的可编辑kendoGrid。我点击编辑按钮,编辑地址弹出窗口出现,但更新按钮不工作,取消按钮删除行

下面是我的代码

数据源

associatedDS = 
new kendo.data.DataSource({        
 data: Data,
 schema: {
  model: {
   id: "AsociatedID",
   fields: {
    Associated: { type: "string", editable: false, nullable: true },
    Addresses: { type: "object", validation: { required: true } }                        
   }
  }  
 }
});
关联的网格

var Associated = 
$("#kgrd_Associated").kendoGrid({
 columns: [
 { field: "AsociatedID", title: "Direccion", width: "100px", },
 { field: "Associated", title: "Direccion", width: "100px", },
 { field: "Addresses", title: "Addresses", width: "350px", editor:addressGridEditor, template: "#= Addresses.length #" },
 { command: ["edit", "destroy"], title: " ", width: "150px"  }
],
dataSource: associatedDS,
editable: "popup",
height: 400,
pageable: true,
scrollable: true,
sortable: true,
selectable: "row",
}).data("kendoGrid"); 
});
网格地址

function editor:addressGridEditor(container, options) {  
 var repgrid = $('<div id="kgrd_Address" data-bind="source:' + options.field + '"></div>')
 .appendTo(container)
 .kendoGrid( {
  columns: [                    
   { field: "Address",   title: "Address", width: "150px"   },
   { command: ["edit", "destroy"],   title: "&nbsp;", width: "150px"  }
  ],
  editable: "popup",
  scrollable: true,
  selectable: "row",
  autoBind: true                
  }).data("kendoGrid");
}
函数编辑器:addressGridEditor(容器,选项){
var repgrid=$('')
.appendTo(容器)
.kendoGrid({
列:[
{字段:“地址”,标题:“地址”,宽度:“150px”},
{命令:[“编辑”、“销毁”],标题:,宽度:“150px”}
],
可编辑:“弹出”,
可滚动:对,
可选:“行”,
自动绑定:对
}).数据(“kendoGrid”);
}
绑定工作正常,但kgrd_地址的数据源未正确生成,因为缺少架构(需要更新)和_pristineData(需要取消)

我不知道我是否遗漏了什么,或者是否有解决办法。考虑到弹出窗口中可能有多个kendoGrid,如idk、kgrd_联系人。

试试这个

  function addressGridEditor(container, options) {  
     var repgrid = $('<div id="kgrd_Address" data-bind="source:' + options.field + '"></div>')
     .appendTo(container)
     .kendoGrid( {
      columns: [                    
       { field: "Address",   title: "Address", width: "150px"   },
       { command: ["edit", "destroy"],   title: "&nbsp;", width: "150px"  }
      ],
      editable: "popup",
      scrollable: true,
      selectable: "row",
      autoBind: true                
      }).data("kendoGrid");
    }
函数addressGridEditor(容器,选项){
var repgrid=$('')
.appendTo(容器)
.kendoGrid({
列:[
{字段:“地址”,标题:“地址”,宽度:“150px”},
{命令:[“编辑”、“销毁”],标题:,宽度:“150px”}
],
可编辑:“弹出”,
可滚动:对,
可选:“行”,
自动绑定:对
}).数据(“kendoGrid”);
}
我认为您必须从函数中删除
编辑器: