且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

对行进行排序后,Ag-grid 拖放不起作用

更新时间:2023-12-03 13:50:58

我找到了一个对我有用的解决方案.如果您面临类似的问题,即您想在排序后启用拖动,则需要像这样禁用排序:

I found a solution that worked for me. if you are facing a similar issue where you want to enable drag after a sort you need to disable the sort like this:

gridColumnApi.applyColumnState({ defaultState: { sort: null } });

gridColumnApi.applyColumnState({ defaultState: { sort: null } });

这会将拖放操作带回到排序之前的列.

this will bring back the drag&drop to the columns you had it prior to the sort.

仍在尝试找到一种方法来告诉网格重新组织其索引,以便我们可以保持排序并同时启用拖动.

Still trying to find a way to tell the grid to reorganize its indexes so we can keep the sort and enable the drag at the same time.