kartik-v / yii2-grid

Enhanced GridView with various utilities for Yii Framework 2.0
http://demos.krajee.com/grid
Other
556 stars 303 forks source link

GridView still loads bootstrap 3 dependency #957

Closed ecmciasabellano1278 closed 4 years ago

ecmciasabellano1278 commented 4 years ago

Hi I'm having a hard time fixing this thing,

When using kartik plugins, I cannot force my site to use Bootstrap 4 even after putting a bsVersion on params and on the pluginOption of that specific plugin.

So what I did was I tweaked the AssetBundle.php on the vendor directory of yii2-krajee-base, commented out the yii\bootstrap\BootstrapAsset and added yii\bootstrap4\BootstrapAsset. That fixed almost all of the kartik plugins to use the Bootstrap 4. But when I use kartik GridView, It loads the Bootstrap 3 and Bootstrap 4, that's why I'm having lots of broken style on that specific page.

Please help me out. Thank you.

kartik-v commented 4 years ago

Please read bootstrap info documentation of setting up bootstrap version for all Krajee extensions. You need not have to edit or tamper with the code of the extensions to achieve this. For example, to set bootstrap version to 4 globally - set the bsVersion to 4.x in your yii2 params.php application config file. This can be set at every Krajee extension level or module level as well. You can also set bsDependencyEnabled to false globally or at each widget level to entirely prevent the extension loading Bootstrap Assets - but you must then load these in your view before calling the extension - else the extension will throw runtime JS/CSS errors.

'params' => [
    'bsVersion' => '4.x', // this will set globally `bsVersion` to Bootstrap 4.x for all Krajee Extensions
    // 'bsDependencyEnabled' => false, // uncomment if you wish to not load bootstrap asset by default
    // other settings
    // 'adminEmail' => 'admin@example.com'
]