Jquery 剑道网格删除层次网格中的行
我想删除剑道网格的层次网格中的行。谁能给我举个例子Jquery 剑道网格删除层次网格中的行,jquery,kendo-ui,grid,hierarchy,Jquery,Kendo Ui,Grid,Hierarchy,我想删除剑道网格的层次网格中的行。谁能给我举个例子 还有一件事,jQuery并不是针对层次结构网格中存在的id/class为的元素。jQuery可以针对主剑道网格中存在的元素,但不能针对/捕获id为/class的层次结构网格中的元素 要从剑道网格中删除行,请添加命令destroy and editable inline/popup。它也适用于层次网格。小型演示: <div id="example"> <div id="grid"></div>
还有一件事,jQuery并不是针对层次结构网格中存在的id/class为的元素。jQuery可以针对主剑道网格中存在的元素,但不能针对/捕获id为/class的层次结构网格中的元素 要从剑道网格中删除行,请添加命令destroy and editable inline/popup。它也适用于层次网格。小型演示:
<div id="example">
<div id="grid"></div>
<script>
$(document).ready(function() {
var element = $("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Employees"
},
pageSize: 6,
serverPaging: true,
serverSorting: true
},
height: 600,
sortable: true,
pageable: true,
detailInit: detailInit,
dataBound: function() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
columns: [
{
field: "FirstName",
title: "First Name",
width: "110px"
},
{
field: "LastName",
title: "Last Name",
width: "110px"
},
{
field: "Country",
width: "110px"
},
{
field: "City",
width: "110px"
},
{
field: "Title"
}
]
});
});
function detailInit(e) {
$("<div/>").appendTo(e.detailCell).kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
serverPaging: true,
serverSorting: true,
serverFiltering: true,
pageSize: 10,
filter: { field: "EmployeeID", operator: "eq", value: e.data.EmployeeID }
},
scrollable: false,
sortable: true,
pageable: true,
columns: [
{ field: "OrderID", width: "70px" },
{ field: "ShipCountry", title:"Ship Country", width: "110px" },
{ field: "ShipAddress", title:"Ship Address" },
{ field: "ShipName", title: "Ship Name", width: "300px" },
{ command: ["destroy"]} // Added the delete command
],
editable: "inline" // set edit mode here
});
}
层次结构网格在detailInit函数中定义,并在层次结构网格中添加destroy命令。
引用自,修改很少
希望这有帮助