我有一个工作网格(字段是名称和 ID):
<grid stuff>
<kendo:grid-column width="80px">
<kendo:grid-column-command>
<kendo:grid-column-commandItem name="delete" text="Delete">
<kendo:grid-column-commandItem-click>
//Here I want to grab this worker id and redirect the user to the url workerDelete.html?Id
</kendo:grid-column-commandItem-click>
</kendo:grid-column-commandItem>
</kendo:grid-column-command>
</kendo:grid-column>
<kendo:grid-column width="80px">
<kendo:grid-column-command>
<kendo:grid-column-commandItem name="update" text="Update">
<kendo:grid-column-commandItem-click>
// here I want to grab this worker id and redirect the user to the url workerUpdate.html?Id
</kendo:grid-column-commandItem-click>
</kendo:grid-column-commandItem>
</kendo:grid-column-command>
</kendo:grid-column>
</grid stuff>
我需要知道当用户按下自定义按钮并更改视图时如何从行中捕获数据,并将数据传递到查询字符串上。我正在使用jsp和spring。
我尝试使用以下代码,但没有奏效:
<script>
function deleteWorker() {
var grid = $('#grid').data('kendoGrid');
var row = grid.dataItem(grid.select());
var id = row.id;
window.location.href = "/workerDelete.html?"+cpf;
}
</script>