升级到 Ag-grid 30 后,我在 moveColumns 函数中遇到了问题。

huangapple go评论119阅读模式
英文:

After upgrading to Ag-grid 30 I have a problem with the moveColumns function

问题

I upgraded ag-Grid 版本从27升级到30,现在columnApi.moveColumns函数不再像之前那样对我起作用。该函数似乎没有改变顺序。

我认为我能够在这个Plnkr中重现这种情况。
在我的情况下,代码是

this.gridColumnApi.moveColumns(['selected', 'ag-Grid-AutoColumn'], 0);

但我修改了一个ag-Grid的代码示例,以模仿我试图做的事情。

提前谢谢。

英文:

I upgraded ag grid version from 27 to 30 and now columnApi.moveColumns function does not work for me as it used to. The function does not seem to change the order.

I think I was able to reproduce the situation in this Plnkr
In my case the code is

this.gridColumnApi.moveColumns(['selected', 'ag-Grid-AutoColumn'], 0);

But I modified an aggrid code example to resemble what I'm trying to do.

Thanks in advance.

答案1

得分: 0

setTimeout解决了这个问题

setTimeout(() => this.gridColumnApi.moveColumns(['selected', 'ag-Grid-AutoColumn'], 0));

英文:

setTimeout solved the problem

setTimeout(() => this.gridColumnApi.moveColumns(['selected', 'ag-Grid-AutoColumn'], 0));

huangapple
  • 本文由 发表于 2023年7月6日 16:52:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76627098.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定