从 Kendo 网格中删除项目而不刷新数据源

Remove Item from Kendo Grid without refreshing datasource

我有一个 Kendo 网格,其中一列是 Boostrap 进度条。它是动画的,代表一个文件上传。(宽度值用angular修改)

项目完成后,我使用这样的删除功能删除项目

Grid.dataSource.remove(item);

然而,网格中的所有其他项目都以某种方式刷新,进度条返回零并重新填充。因此,如果列表中的某个项目处于 70%,它将归零并快速重新填充。

它在一瞬间发生得非常快,但看起来很糟糕。

是否可以停止其他项目的刷新,只删除数据源中的单个项目?

这是对我有用的方法,只要您选择了要删除的行。

var grid= $("#Grid").data("kendoGrid");
grid.removeRow(grid.select());

如果没有手动选择过,可以通过js选择:

grid.select(-1); //this cleans the current selection
var tr = $("#Grid").find("tbody").find("tr")[index]; // 0 based index of the item you want to select
grid.select(tr);

试试看,如果有帮助请告诉我