$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));
}
At this code, you will see that I did DOM manipulation, because I did not get row index from parameter e
. Please help me to get the row index.
我可以建议您使用Grid的removeRow方法并仅传递TR元素(无法避免访问TR元素)。
grid.removeRow($(e.target).closest('tr'))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.