Extjs网格单元格编辑器跳离单元格(Extjs grid cell editor jumps away from cell)

系统教程 行业动态 更新时间:2024-06-14 16:59:47
Extjs网格单元格编辑器跳离单元格(Extjs grid cell editor jumps away from cell)

我在Extjs网格编辑中遇到了这个问题。 当我从下拉列表编辑器切换到textarea编辑器时,textarea编辑器跳下屏幕,远离我应该编辑的单元格:

我不知道如何解决这个问题。 它只发生1/2的时间,所以我相信有一些竞争条件,但我不确定。 我花了很多时间调试和单步执行编辑代码,textarea从网格单元格开始,但是某些事件会触发,然后它会移动。

Im having this issue in Extjs grid editing. When I tab from a dropdown editor to a textarea editor, the textarea editor jumps down the screen, away from the cell I should be editing:

I have no idea how to fix this. It only happens 1/2 of the time, so I believe there is some race condition, but Im not sure. Ive spent a lot of time debugging and stepping through the editing code and the textarea starts out in the grid cell, but some event fires or something and it then moves.

最满意答案

我发现了问题,但我认为没有一个好的解决方案。 单击选项卡完成编辑后,新值将放入网格单元格中。

网格行高度可能会更改,这将导致网格视口大小更改(因为我没有使用滚动条..网格高度会动态增长和缩小)。

网格在iframe中,并且我将侦听器附加到grid resize事件以将iframe高度更改为网格高度的大小,这反过来导致浮动元素(例如单元格编辑器)被重新定位。

所以我的问题是我希望iframe随网格一起增长,网格会随着细胞的编辑而增长和缩小(缩小几个像素)。 但这会导致浮动元素跳跃。

I found the problem, but I don't think there is a good solution to it. When I complete the edit by clicking tab, new value is put in the grid cell.

The grid row height might change, which will cause the grid viewport size to change (since i am not using a scroll bar.. the grid height grows and shrinks dynamically).

The grid is in an iframe, and i attached a listener to the grid resize event to change the iframe height to be the size of the grid height, this in turn caused floating elements (such as a cell editor) to be repositioned.

So my problem is that i want the iframe to grow with the grid, which grows and shrinks (by a few pixels) as cells get edited. But this causes the floating element to jump.

更多推荐

本文发布于:2023-04-17 09:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/437a86e318bb7cad154b537e621c1f1e.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元格   网格   编辑器   Extjs   jumps

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!