Open mati950708 opened 6 years ago
Same problem here. Even if loading in ajax but not in modal. By the way, for DateControl, i solved the same problem executing
DateControl::widget([
'name'=>'date_control_fix',
'type'=>DateControl::FORMAT_DATE,
]);
(note, there's no need to echo) in a view which gets loaded without ajax. With this when the ajax view echoes the datecontrol widget i don't have the blink (probably there's some asset loading problem in ajax). It's not great, but it fixes the problem. But it doesn't work with Select2
The renderAjax
method re-registers all assets on your page again - which maybe registering JS/CSS again and overwriting markups - causing reinitializing of plugins and HTML content/markup and hence the behavior on the client will be specific to what you are rendering essentially. If some asset bundles are already registered on your page (depending on your view/page design) you may need to skip registering these asset bundles unnecessarily if not needed - (unset these selective asset bundles in your view selectively during the ajax render option).
In any case, more a UX/UI design issue that you may want to check - where one option is you may try to ensure that ajax based loads always hide your parent container and rather show a loading indicator with everything else hidden and after everything is done (ajax is complete) - show back the main container.
The other option is to avoid using renderAjax and use a normal renderPartial and rather use a PJAX Widget to dynamically render content and set pjaxContainerId
property within the Krajee widget which will auto re-initialize the related Krajee jquery plugins after every pjax reload.
Hi, i´m having some issues with the kartik library, I noticed that whe I put the kartik library in the form, wich is render in Ajax and showed in a modal, a strange blink happens in the screen when the modal is loaded... It works... but after that blink if I click outside the modal or close it and try to "view" any item, my whole index ends up in ajax.
This is my _form:
`
<?php
use yii\helpers\Html; //use yii\widgets\ActiveForm; //use yii\bootstrap\ActiveForm; use kartik\widgets\ActiveForm; use kartik\select2\Select2; use yii\helpers\ArrayHelper;
/ @var $this yii\web\View / / @var $model backend\models\RestriccionesDeUsuario / / @var $form yii\widgets\ActiveForm / ?>