ページの先頭行へ戻る
Interstage Interaction Manager V10.1.2 AjaxフレームワークUI部品リファレンス
FUJITSU Software

5.1.16 ContextMenuに関するInternet Explorerの注意事項

Internet Explorer 9 互換でContextMenuを利用する場合、マウスの右クリック時に、対象となるHTML要素の状態によって、ContextMenuを正しい位置に表示できないことがあります。

以下の例のように、対象となるHTML要素の状態を判定して、正しい位置にContextMenuを表示できる要素上でContextMenuを表示するようにしてください。

  RCF.addInitializedListener(function(eventObject) {
      ...
      // 右クリックで呼び出すContextMenuを切替え表示
         ctxm_mgr.onContextMenuByElement(document, mkContextMenu);
      ...
  });
  function mkContextMenu(eventObject) {

       // 表示位置変更のため一旦非表示
      rcf.widget.menu.ContextMenuManager.getInstance().hideAll();

        if(eventObject.srcElement && eventObject.srcElement.tagName !== undefined){   // Internet Explorerの場合
             ctxm.show(eventObject);
        }
        else if (!eventObject.srcElement)  {
            ctxm.show(eventObject);
        }
  }