首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ExtJS4中的网格焦点问题

ExtJS4中的网格焦点问题
EN

Stack Overflow用户
提问于 2011-07-22 21:52:25
回答 1查看 1.8K关注 0票数 4

我们在应用程序中使用ExtJS4。我们遇到了网格focus.We在ExtJS3中使用grid.getView().focusEl.focus()的问题。现在看来,在ExtJS4中,这不是working.What,而是它的替代品。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-22 23:04:58

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

在ExtJS3中,focusEl是视图中的锚链接

代码语言:javascript
复制
<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中,此锚链接不存在

解决方案

这是我为你创建的一个小fiddle test。基本上,您需要更改的内容如下:

代码语言:javascript
复制
grid.getView().el.focus();

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

希望这能解决你的问题。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6791029

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档