title: How to trigger Yii2 Confirm Dialog
body: <p>I have a custom <code>ActionColumn</code> on <code>GridView</code> and trying to call <strong>yii.confirm</strong> function using <strong>data-confirm</strong> for delete action but the dialog not shown.</p>
  
  <pre><code>[
  'format'=&gt;'html',
  'content'=&gt;function($data) {
      $btn = ButtonDropdown::widget([
      'label' =&gt; 'Action',
      'options' =&gt; ['class'=&gt;'btn btn-sm btn-primary dropdown-toggle', 'type'=&gt;'button'],
      'dropdown' =&gt; [
          'options' =&gt; ['class'=&gt;'dropdown-menu action', 'role'=&gt;'menu'],
          'items' =&gt; [
              '&lt;li&gt;&lt;a href="'.Url::to(['details','id'=&gt;$data-&gt;id]) .'"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt; Details&lt;/a&gt;&lt;/li&gt;',
              '&lt;li&gt;&lt;a href="'. Url::to(['edit', 'id' =&gt; $data-&gt;id]) .'"&gt;&lt;i class="fa fa-eye"&gt;&lt;/i&gt; Edit&lt;/a&gt;&lt;/li&gt;',
              '&lt;li role="presentation" class="divider"&gt;&lt;/li&gt;',
              '&lt;li&gt;&lt;a data-method="post" data-confirm="Are you sure ?" href="'.Url::to(['delete', 'id' =&gt; $data-&gt;id]).'"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt; Delete&lt;/a&gt;&lt;/li&gt;',                                                
          ],
      ],
  ]);
  return $btn;
  },
  ],
  </code></pre>
  
  <p>But when I'm trying to add link without dropdown it works</p>
  
  <pre><code>[
  'format'=&gt;'html',//raw, html
      'content'=&gt;function($data) {
          $btn ='&lt;a data-method="post" data-confirm="Are you sure ?" href="'.Url::to(['delete', 'id' =&gt; $data-&gt;id]).'"&gt;&lt;i class="fa   fa-trash"&gt;&lt;/i&gt; Delete&lt;/a&gt;';                                                
          return $btn;
      },
  ],
  </code></pre>