![](/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.