LoginSignup
1
1

More than 5 years have passed since last update.

Toolbarのボタンからオーバーレイ表示

Posted at

概要

Toolbarにあるボタンを表示すると、ボタン下部にオーバーレイ表示したパネルを表示させる

コード

  • Toolbarコンポーネントのボタンに対して、別パネルcreateする
  • 生成したコンポーネントに対して
overlay.js
  xtype: 'button',
  text: 'overlay',
  handler: function(btn, event){
      var main = btn.getParent().getParent();
      main.overlay = Ext.create('Ext.Panel', {
          html: 'panel text',
          modal: true, // true:表示したオーバーレイの背面をグレーアウトさせ操作できないようにする
          width: 300,
          height: 400,
          scrollable: true,
          top: 0,
          left: 0
      });
      // オーバーレイさせるパネルから吹き出しを表示してどのボタンから
      // 表示したのかわかりやすくする
      // btn:対象のボタン
      main.overlay.showBy(btn);

  }

サンプルコード

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1