Yii Framework Forum: Yiibooster :: Bootbox - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yiibooster :: Bootbox bootbox.modal() does not generate .modal-dialog and .modal-content div Rate Topic: -----

#1 User is offline   casamajor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 23-April 14

Posted 23 April 2014 - 07:35 PM

Hi,

I got stuck trying to create a modal with YiiBooster's bootbox extension. I am using the last version of YiiBooster and I need this TbButton to open a modal that shows some HTML content:

<?php
$this->widget(
    'bootstrap.widgets.TbButton',
    array(
        'label' => Yii::t('xxx', 'xxx'),
        'type' => 'info',
        'size' => 'mini',
        'htmlOptions' => array(
            'onclick' => 'js:bootbox.modal(
                "<iframe width=\"640\" height=\"480\" src=\"' . GxHtml::encode($model->video_url) . '\" frameborder=\"0\" allowfullscreen></iframe>",
                "Some title"
            );'
        ),
    )
);
?>


I expect it to create something like this:

<div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" style="display: block;" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;">×</button>
                <div class="bootbox-body">
                    ...
                </div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="ok" type="button" class="btn btn-primary">OK</button>
            </div>
        </div>
    </div>
</div>


But instead it generates just this:

<div class="bootbox modal fade in" tabindex="-1" style="overflow: hidden; display: block;" aria-hidden="false">
    <div class="modal-header">
        <a href="javascript:;" class="close">×</a>
        ...
    </div>
    <div class="modal-body">
        ...
    </div>
</div>


Since .modal-dialog and .modal-content divs are missing, the modal "container" does not show up: only its contents do (on transparent background). What should I add to the code so that it create the container divs as well?

Thank you!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users