kartik-v / yii2-grid

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

jquery.js:4095 Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode') #1069

Closed t28hk closed 1 year ago

t28hk commented 1 year ago

Hi there, I used these steps install yii2 and yii2-grid,

$ composer create-project --prefer-dist yiisoft/yii2-app-basic $ composer require kartik-v/yii2-grid "dev-master" $ composer require kartik-v/yii2-bootstrap5-dropdown '@dev'

I created a controller, use kartik\grid\GridView show the grid, in chrome F12, Console, I get this error, I do not know why, when I use yii\grid\GridView this error not show.

jquery.js:4086 jQuery.Deferred exception: Cannot read properties of undefined (reading 'parentNode') TypeError: Cannot read properties of undefined (reading 'parentNode') at new Dropdown (http://test.com/assets/dd5f45e3/dist/js/bootstrap.bundle.js:3601:36) at HTMLDocument. (http://test.com/country/index:525:2) at mightThrow (http://test.com/assets/16e03fba/jquery.js:3802:29) at process (http://test.com/assets/16e03fba/jquery.js:3870:12) undefined jQuery.Deferred.exceptionHook @ jquery.js:4086 process @ jquery.js:3874 setTimeout (async) (anonymous) @ jquery.js:3908 fire @ jquery.js:3536 fireWith @ jquery.js:3666 fire @ jquery.js:3674 fire @ jquery.js:3536 fireWith @ jquery.js:3666 ready @ jquery.js:4146 completed @ jquery.js:4156 jquery.js:4095 Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode') at new Dropdown (dropdown.js:98:34) at HTMLDocument. (index:525:2) at mightThrow (jquery.js:3802:29) at process (jquery.js:3870:12)

Yii2 basic version 2.0.48.1, Bootstrap version 5.3.0

matteo-cerioni commented 1 year ago

I had the same problem, i fixed it downgrading "yii2-bootstrap5" package from version 2.0.4 to version 2.0.3

t28hk commented 1 year ago

I had the same problem, i fixed it downgrading "yii2-bootstrap5" package from version 2.0.4 to version 2.0.3

I do the same way, downgrade yii2-bootstrap5 from 2.0.4 to 2.0.3, this error does not happen. This is the only way I can find so far.

kartik-v commented 1 year ago

Related to issue #1056 and alternative workaround is described in the comment - its an issue with a breaking change in the yii2-bootstrap5 library...

kartik-v commented 1 year ago

This has been resolved via fixes provided to #1056.