kartik-v / yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle switches (sub repo split from yii2-widgets)
Other
38 stars 11 forks source link

RenderAjax within kartik-tab-x #25

Open robov opened 7 years ago

robov commented 7 years ago

I have a switchinput in my subpage that is rendered with ajax with the tab-x This works find... However... When I look at the return of the renderAjax('view') of this subform it includes

<link href=\"/assets/676e3db8/css/bootstrap.css\" rel=\"stylesheet\">\ .. etc

as part of the ajaxRendering ... This reloading of the css screws up my view... any idea why these assets are loaded. When I remove the switchinput from the view, these css are no longer loaded and my view is perfect.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41188134-renderajax-within-kartik-tab-x?utm_campaign=plugin&utm_content=tracker%2F8186004&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F8186004&utm_medium=issues&utm_source=github).
robov commented 7 years ago

also when I do

echo $this->renderAjax('setting_tab/_preview_form', ['model' => $model,]);

in a regular view... the css is still reloaded like

<div class="help-block"></div>
</div></form><link href="/assets/676e3db8/css/bootstrap.css" rel="stylesheet">
<link href="/assets/4445b25b/css/bootstrap-switch.css" rel="stylesheet">
<link href="/assets/4445b25b/css/bootstrap-switch-kv.css" rel="stylesheet">
<link href="/assets/36c7789d/css/kv-widgets.css" rel="stylesheet">
<script type="text/javascript">var bootstrapSwitch_29bf9f81 = {"animate":true,"indeterminate":false,"disabled":false,"readonly":false};
</script><div class="transfer_setup">

On views without the switchinput these CSS are not reloaded