-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not loading a Toolbar using GridView causes JS error with Export dropdown #1059
Comments
I have the same error: (new bootstrap.Dropdown('#w3-button', {})); Uncaught TypeError: this._element is undefined The export toolbar (dropdown) causes an error which also let pjax stop working, etc. |
I have also the problem, that the column button don't open (class="show" assign). I've tried to set the export ("kartik-v/yii2-export": "dev-master",) in composer file and now the column button dropdown open (version problem). I've tested a lot. I dont' know why, the problem occurs when I use \kartik\tabs\TabsX::widget
Maybe due to the fact, that the nav widget also use a similiar id like 'W1"? (new bootstrap.Dropdown('#w3-button', {})); |
@bay-jacewhitten: do you also use \kartik\tabs\TabsX Widget at the same time? |
@strtob No I do not. I just use the standard bootstrap css and js for tabs. A recent 'hack' to stop the error from bubbling up. Sorry for the bad indent, the '' is on the next line. Note the toolbar is in the layout, but I am setting the options with the content key. |
Thank you for sharing! I've added empty div elements with the #w ids, without any errors, but this can't be the solution |
I've not found the relevant position in the code to fix it, is this a problem of @kartik-v exportmenu or dropdown.js? |
There are some more details. How can the creation of these files avoid?
|
Folks can you check if you can try to force |
Use this as an interim solution and use yiisoft/yii2-bootstrap5 v2.0.3 due to BC breaking changes in later yiisoft/yii2-bootstrap5 versions. There is a PR # 54 suggested in yii2-bootstrap5 newer version - if that is accepted it should probably resolve this issue. In case the PR is not accepted, there is some set of changes needed in these widgets and isolate dependency from yii2-bootstrap5. |
Enhancements provided as part of release v3.5.1 as mentioned here in #1056. Kindly test if it resolves the issue. |
Prerequisites
master
branch of yii2-export.Steps to reproduce the issue
Expected behavior and actual behavior
When I follow those steps, I see... a console error 'Not able to find parentNode' This is due to an extra dropdown call being injected.
I was expecting... A quiet console.
Workaround: I was able to just add the toolbar, but set the content to '' and the class to 'd-none'. I also added the missing id for my sake. But as a hack.
Environment
Browsers
Operating System
Libraries
Isolating the problem
The text was updated successfully, but these errors were encountered: