Php 模态内的Yi2 popover-x
我有一个情态动词。现在我想添加到注入表单中Php 模态内的Yi2 popover-x,php,yii2,kartik-v,Php,Yii2,Kartik V,我有一个情态动词。现在我想添加到注入表单中 <div class="ensemble-form-add"> <?php $content = '<p class="text-justify">sometext</p>'; echo PopoverX::widget([ 'id' => 'ownShit', 'header' => 'Usage Information',
<div class="ensemble-form-add">
<?php
$content = '<p class="text-justify">sometext</p>';
echo PopoverX::widget([
'id' => 'ownShit',
'header' => 'Usage Information',
'size' => PopoverX::SIZE_LARGE,
'placement' => PopoverX::ALIGN_BOTTOM,
'content' => $content,
'toggleButton' => ['label'=>'<span class="glyphicon glyphicon-question-sign"></span>', 'class'=>'btn btn-lg btn-link'],
]); ?>
<?php $form = ActiveForm::begin(['id' => 'add ...
...
我终于让它工作了。我使用了以下代码:
并添加了以下js,使其像一个魅力
$(function(){
// this will show the popover within a modal window
$('#modal').on('shown.bs.modal', function(){
$('[data-toggle="popover"]').popover();
});
});
尝试了另一种没有PopoverX的方法。不幸的是,在模式窗口中也无法使此项工作。除此之外,没问题。
$(function(){
// this will show the popover within a modal window
$('#modal').on('shown.bs.modal', function(){
$('[data-toggle="popover"]').popover();
});
});