簡體   English   中英

ExtJS4 中的網格焦點問題

[英]grid focus issue in ExtJS4

我們在我們的應用程序中使用 ExtJS4。 網格焦點有問題。我們在 ExtJS3 中使用grid.getView().focusEl.focus() 現在看來這不起作用。ExtJS4 中這個的替代品是什么。

我已經幫助您檢查了 ExtJS3 和 ExtJS4 的差異,主要變化是 focusEl 已從 gridView 元素中刪除。

在 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 中,這個錨鏈接不存在

解決方案

這是我為您創建的一個小小提琴測試 基本上您需要更改的內容如下:

grid.getView().el.focus();

我們使用整個元素,而不是獲取 focusEl(錨鏈接)。

希望這能解決您的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM