gpt4 book ai didi

extjs - ExtJS4 中的网格焦点问题

转载 作者:行者123 更新时间:2023-12-05 00:37:32 32 4
gpt4 key购买 nike

我们在我们的应用程序中使用 ExtJS4。我们的网格焦点有问题。我们正在使用 grid.getView().focusEl.focus()在 ExtJS3 中。现在看来这个不行了。ExtJS4 中这个的替代品是什么?

最佳答案

我已经帮你检查了 ExtJS3 和 ExtJS4 的区别,主要的变化是 focusEl 已从 gridView 元素中删除。

在 ExtJS3 中,focusEl 是 View 中的 anchor 链接

<div class="x-grid3-scroller" id="ext-gen10" style="width: 298px; height: 174px; ">
<div class="x-grid3-body" style="width:100px;" id="ext-gen12">
<div class="x-grid3-row x-grid3-row-first x-grid3-row-last" style="width:100px;">
<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="width:100px;">
<tbody>
<tr><td class="x-grid3-col x-grid3-cell x-grid3-td-0 x-grid3-cell-first " style="width: 100px;" tabindex="0"><div class="x-grid3-cell-inner x-grid3-col-0" unselectable="on">0</div></td></tr>
</tbody>
</table>
</div>
</div>
<a href="#" class="x-grid3-focus" tabindex="-1" id="ext-gen13"></a>
</div>

在 ExtJS4 中,此 anchor 链接不存在

解决方案

这是一个小 fiddle test我已经为你创造了。基本上你需要改变的内容如下:
grid.getView().el.focus();

我们使用整个元素,而不是获取 focusEl(一个 anchor 链接)。

希望这能解决您的问题。

关于extjs - ExtJS4 中的网格焦点问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6791029/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com