(备选方案)
添加一个模板并创建一个自定义工具栏按钮“添加新记录”,并在该按钮上附加一个事件
类似于这样的东西
<script type="text/x-kendo-template" id="template">
<input type="button" value="Add new record" onClick="YOURFUNCTION()" class="k-button"/>
</script>
<script>
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
toolbar: [{text: "", template: kendo.template($("#template").html())}],
columns: [
"ProductName",
{ field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px" },
{ field: "UnitsInStock", title:"Units In Stock", width: "120px" },
{ field: "Discontinued", width: "120px" },
{ command: ["edit", "destroy"], title: " ", width: "200px" }],
editable: "inline"
});
});
</script>
return false
和e.preventDefault(); e.stopPropagation();
是一样的。 - Kartikeya Khosla