karnbrockgmbh / yii2-modal-ajax

MIT License
13 stars 8 forks source link

Form not displayed in modal #2

Open loveorigami opened 8 years ago

loveorigami commented 8 years ago

I am create view as

use yii\helpers\Url;
use lo\core\widgets\admin\Form;
use karnbrockgmbh\modal\Modal;

/**
 * @var common\models\Page $model модель
 */

Modal::begin([
    'id' => 'createAuthor',
    'url' => Url::to(['/love/author/create']), // Ajax view with form to load
    'ajaxSubmit' => true, // Submit the contained form as ajax, true by default
    // ... any other yii2 bootstrap modal option you need
    'header' => 'Add Author',
    'toggleButton' => [
        'label' => 'click me',
        'data-target' => '#createAuthor',
    ],
]);
Modal::end();

After clicking on button, I have author form in console, but not find it in modal

0001

loveorigami commented 8 years ago

I am replaced here https://github.com/karnbrockgmbh/yii2-modal-ajax/blob/master/assets/js/kb-modal-ajax.js#L57

jQuery(this.element).find('.modal-body').html(data);

and form is shown...

loveorigami commented 8 years ago

and next i find mistake )) here https://github.com/karnbrockgmbh/yii2-modal-ajax/blob/master/assets/js/kb-modal-ajax.js#L79 need jQuery(this.element).find('.modal-body').html(html);

nazakar commented 8 years ago

Unfortunately after changing code, modal is empty

loveorigami commented 8 years ago

@nazakar clear assets? for me - worked fine with #3

nazakar commented 8 years ago

Thanks, everything is OK!