【发布时间】:2019-10-08 00:55:53
【问题描述】:
如何在剑道ui网格内联编辑中使用blockSpecialChar这个功能?基本上我想要ProductName 列不允许空格或除/ 之外的其他符号。我尝试使用editor 和template 调用该函数,但它不起作用。
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
toolbar: ["create"],
columns: [
{ field: "ProductName", title: "Product Name" },
{ field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px" },
{ field: "UnitsInStock", title:"Units In Stock", width: "120px" },
{ field: "Discontinued", width: "120px", editor: customBoolEditor },
{ command: ["edit", "destroy"], title: " ", width: "250px" }],
editable: "inline"
});
function blockSpecialChar(e){
var k;
document.all ? k = e.keyCode : k = e.which;
return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 && k == 32 || k == 47 || (k >= 48 && k <= 57));
}
【问题讨论】:
标签: kendo-ui kendo-grid