Kendo ui 使用dropdownlist更新剑道ui网格
我在更新剑道ui网格时遇到问题。Kendo ui 使用dropdownlist更新剑道ui网格,kendo-ui,Kendo Ui,我在更新剑道ui网格时遇到问题。 我创建的网格如下所示: , 但我还添加了更新功能 我的问题在下一个 更新网格后,更新请求正常(POST url 200 OK),但在更新后,浏览器控制台中出现错误: TypeError: Distribution is undefined. Distribution是下拉列表中的数据类型 这是我的密码: dataSource: ... update: { url: "/Modeling/EditCurrentStates", type:
我创建的网格如下所示: , 但我还添加了更新功能 我的问题在下一个 更新网格后,更新请求正常(POST url 200 OK),但在更新后,浏览器控制台中出现错误:
TypeError: Distribution is undefined.
Distribution是下拉列表中的数据类型
这是我的密码:
dataSource:
...
update: {
url: "/Modeling/EditCurrentStates",
type: "POST"
}
...
schema: {
model: {
id: "StateNumber",
fields: {
...
Distribution: { defaultValue: { Id: 1, Name: "Exponential"}
...
columns: [
...
{
field: "Distribution",
title: "Distribution",
editor: distributionDropDownEditor,
template: "#=Distribution.Name#"
},
function distributionDropDownEditor(container, options) {
$('<input data-text-field="Name" data-value-field="Id" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: {
type: "json",
transport: {
read: "/Modeling/GetDistributions"
}
}
});
}
数据源:
...
更新:{
url:“/Modeling/editCurrentState”,
类型:“职位”
}
...
模式:{
型号:{
id:“州号”,
字段:{
...
分布:{defaultValue:{Id:1,名称:“指数”}
...
栏目:[
...
{
字段:“分发”,
标题:“分发”,
编辑:distributionDropDownEditor,
模板:“#=分发。名称#”
},
函数distributionDropDownEditor(容器、选项){
$('')
.appendTo(容器)
.kendoDropDownList({
自动绑定:错误,
数据源:{
键入:“json”,
运输:{
阅读:“/Modeling/GetDistributions”
}
}
});
}
您没有定义剑道数据的来源。您需要
数据:“数据”
数据源:
...
更新:{
url:“/Modeling/editCurrentState”,
类型:“职位”
}
...
模式:{
数据:“数据”,
型号:{
id:“州号”,
字段:{
...
分布:{defaultValue:{Id:1,名称:“指数”}
...
栏目:[
...
{
字段:“分发”,
标题:“зззЮзЮЮзЮЮ”,
编辑:distributionDropDownEditor,
模板:“#=分发。名称#”
},
函数distributionDropDownEditor(容器、选项){
$('')
.appendTo(容器)
.kendoDropDownList({
自动绑定:错误,
数据源:{
键入:“json”,
运输:{
阅读:“/Modeling/GetDistributions”
}
}
});
}
您没有定义剑道数据的来源。您需要
数据:“数据”
数据源:
...
更新:{
url:“/Modeling/editCurrentState”,
类型:“职位”
}
...
模式:{
数据:“数据”,
型号:{
id:“州号”,
字段:{
...
分布:{defaultValue:{Id:1,名称:“指数”}
...
栏目:[
...
{
字段:“分发”,
标题:“зззЮзЮЮзЮЮ”,
编辑:distributionDropDownEditor,
模板:“#=分发。名称#”
},
函数distributionDropDownEditor(容器、选项){
$('')
.appendTo(容器)
.kendoDropDownList({
自动绑定:错误,
数据源:{
键入:“json”,
运输:{
阅读:“/Modeling/GetDistributions”
}
}
});
}
dataSource:
...
update: {
url: "/Modeling/EditCurrentStates",
type: "POST"
}
...
schema: {
data: "data",
model: {
id: "StateNumber",
fields: {
...
Distribution: { defaultValue: { Id: 1, Name: "Exponential"}
...
columns: [
...
{
field: "Distribution",
title: "Розподіл",
editor: distributionDropDownEditor,
template: "#=Distribution.Name#"
},
function distributionDropDownEditor(container, options) {
$('<input data-text-field="Name" data-value-field="Id" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: {
type: "json",
transport: {
read: "/Modeling/GetDistributions"
}
}
});
}