ngGrid - 删除一行 [英] ngGrid - remove row
本文介绍了ngGrid - 删除一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找如何实现一个按钮来删除选定行的一个例子,但我找不到任何迄今有用的。
I have been looking for an example on how to implement a button to remove a selected row, but I couldn't find anything useful so far.
任何人都可以,请给我一个提示?这里是 plunker 例子。
Can anyone please give me a hint? Here is the plunker example.
我实现的功能行为怪异,因为它消除其他行。
The function I implement acts weird, as it removes other rows.
感谢您。
推荐答案
这是不要删除任何行有道
That is not a proper way to delete any row
尝试这样的:
$scope.removeRow = function() {
var index = this.row.rowIndex;
$scope.gridOptions.selectItem(index, false);
$scope.myData.splice(index, 1);
};
PLUNKER - >
其工作和测试
这篇关于ngGrid - 删除一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文