![](/img/trans.png)
[英]How do I get the index and data of a selected row in a grouped Kendo grid
[英]how do I get kendo angular grid row index from event parameter(e)
$scope.deleteClick = function(e){
e.preventDefault();
var datasource = $scope.mygrid.datasource;
var index = $(e.target).closest("tr")[0].rowIndex;
datasource.remove(datasource.at(index -1));
}
在这段代码中,您将看到我进行了DOM操作,因为我没有从参数e
获得行索引。 请帮助我获取行索引。
我可以建议您使用Grid的removeRow方法并仅传递TR元素(无法避免访问TR元素)。
grid.removeRow($(e.target).closest('tr'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.