Kendo ui 自定义弹出模板取消绑定错误的剑道UI网格
这是一个JSFIDLE(不是我的,但同样的错误)。Kendo ui 自定义弹出模板取消绑定错误的剑道UI网格,kendo-ui,Kendo Ui,这是一个JSFIDLE(不是我的,但同样的错误)。 $(document).ready(function() { $("#search").click(function() { // alert("clicked refresh"); $("#grid").data("kendoGrid").dataSource.read(); }
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
章名
陈述
代码
添加日期
活跃的
经核准的
章价
母价
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
$(文档).ready(函数(){
$(“#搜索”)。单击(函数(){
//警报(“单击刷新”);
$(“#网格”).data(“kendoGrid”).dataSource.read();
});
$(“#网格”).kendoGrid({
数据源:{
运输:{
阅读:{
url:“chaptersJson.cfm”,
数据类型:“json”,
数据:{q:function(){return$(“#chapterName”).val();}
},
更新:{
url:“chaptersJson.cfm?pageaction=Update”,
数据类型:“json”
}
},
模式:{
型号:{
id:“chapterid”,
字段:{
章节ID:{type:“number”},
chaptername:{type:“string”},
活动:{type:“string”},
已批准:{type:“string”},
chaperpice:{type:“string”},
父价格:{type:“string”},
代码:{type:“string”},
dateadded:{type:“date”},
状态:{type:“string”}
}
}
},
页面大小:25
},
身高:500,
可过滤:false,
可排序:是的,
pageable:对,
列:[{字段:“chaptername”,标题:“Chapter”,宽度:200},
{字段:“州”,标题:“州”,宽度:100},
{字段:“Chaperpice”,标题:“章节价格”,宽度:100},
{字段:“父价格”,标题:“父价格”,宽度:100},
{字段:“dateadded”,标题:“Added On”,宽度:100,模板:'#=kendo.toString(dateadded,“MM/dd/yyyy”)#',
{命令:[“编辑”],标题:“”,宽度:“210px”}
],
可编辑:{mode:“popup”,模板:$(“#popup_编辑器”).html()}
});
});
当您尝试打开弹出窗口,然后单击X关闭或取消按钮时,它不会关闭并返回:
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
未捕获的TypeError:------------没有方法“解除绑定”
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
我基本上是用KendoUI创建一个常规的网格,但是我想要一个自定义的弹出编辑器来显示网格当前显示的更多字段 更新版本,错误应该消失(因为它已修复)
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
基本上,您只需要将脚本和样式引用更改为指向版本913而不是710
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
e、 g
$(document).ready(function() {
$("#search").click(function() {
// alert("clicked refresh");
$("#grid").data("kendoGrid").dataSource.read();
});
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "chaptersJson.cfm",
dataType: "json",
data: {q: function() { return $("#chapterName").val();}}
},
update: {
url: "chaptersJson.cfm?pageaction=Update",
dataType: "json"
}
},
schema: {
model: {
id: "chapterid",
fields: {
chapterid: { type:"number" },
chaptername: { type: "string" },
active: {type: "string"},
approved: {type: "string"},
chapterPrice: {type: "string"},
parentPrice: {type:"string"},
code: {type:"string"},
dateadded: {type:"date"},
state: {type:"string"}
}
}
},
pageSize: 25
},
height: 500,
filterable: false,
sortable: true,
pageable: true,
columns: [{field: "chaptername", title: "Chapter", width: 200},
{field: "state", title:"State", width: 100},
{field: "chapterPrice", title:"Chapter Price", width: 100},
{field: "parentPrice", title:"Parent Price", width: 100},
{field: "dateadded", title:"Added On", width: 100, template: '#= kendo.toString(dateadded,"MM/dd/yyyy") #'},
{command: ["edit"], title:" ", width:"210px"}
],
editable: {mode: "popup", template: $("#popup_editor").html()}
});
});
</script>
您的弹出式html编辑器是什么样子的?谢谢您的回复。我更新了上面的代码以包含它。我模仿了我看到的另一个例子。谢谢你的回复。今天早上我更新了他们刚刚发布的新测试版,它修复了我一半的问题。窗口现在将关闭,但控制台仍显示UncaughtTypeError:对象(字段值)没有“解除绑定”方法。至少现在它已经关闭了,我将努力完成我的脚本以进行更新和添加,并看看我可以从那里得到什么。:)今天有正式版本,所以你不需要再使用测试版了