我们在应用程序中使用ExtJS4。我们遇到了网格focus.We在ExtJS3中使用grid.getView().focusEl.focus()的问题。现在看来,在ExtJS4中,这不是working.What,而是它的替代品。
发布于 2011-07-22 23:04:58
我已经帮助您检查了ExtJS3和ExtJS4之间的区别,主要的变化是从gridView元素中删除了focusEl。
在ExtJS3中,focusEl是视图中的锚链接
<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。基本上,您需要更改的内容如下:
grid.getView().el.focus();我们使用整个元素,而不是获取focusEl (一个锚链接)。
希望这能解决你的问题。
https://stackoverflow.com/questions/6791029
复制相似问题