簡體   English   中英

如何從事件參數獲取劍道角網格行索引

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM