我是剑道网络用户界面的新手。我想实现内联编辑网格。当我单击添加/编辑按钮时,我们得到带有更新按钮的内联表单字段,我想为每一行获取唯一的 ID 和自定义的更新按钮功能,以便我可以更新我的数据库。
<table id="grid11" style="table-layout: fixed; display:none;">
<colgroup>
<col style="width:10%">
<col style="width:20%">
<col style="width:20%">
<col style="width:20%">
<col style="width:30%">
</colgroup>
<thead>
<tr>
<th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Qty</font></th>
<th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Unit</font></th>
<th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Style Number</font></th>
<th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Description</font></th> <th><font style="font-weight:bolder; color:#7ea700; font-size:16px;">Command</font></th>
</tr>
</thead>
<tbody>
<tr>
<td>10</td>
<td>12</td>
<td>231234</td>
<td>ItemDescription</td>
<td></td>
</tr>
</tbody>
</table>
<script>
$(document).ready(function(){
$("#grid11").kendoGrid({
dataSource: {
schema: {
model: { id: "id" },
fields: {
id: { editable: false, nullable: true },
Qty: { validation: { required: true } },
Unit: { validation: { required: true } },
StyleNumber: { validation: { required: true } },
Description: { validation: { required: true } },
}
},
pageSize: 5
},
pageable: true,
height: 300,
sortable: true,
toolbar: [{name:"create",text:"Add"}],
editable: "inline",
columns: [
{field: "Qty"},
{field: "Unit"},
{field: "StyleNumber"},
{field: "Description"},
{ command: ["edit", "destroy"], title: " ", width: "172px" }]
});
$("#grid11").show();
});
</script>
请帮我。
谢谢