We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Weird Modal Issue

Developer Preview

TJ Draper's avatar
TJ Draper
222 posts
7 years ago
TJ Draper's avatar TJ Draper

I’m having a strange issue with modal buttons in a Grid field with my add-on field type Treasury. Specifically, usually the first request for the modal fails. The modal comes up but has no content. The button for the modal has an m-link class and an href to fetch the content from. I’ve documented the issue in a short video: https://vimeo.com/252369002/e26b201215

Any thoughts?

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

Do you have a race condition, clicking the button before events are fully bound to the new elements?

       
TJ Draper's avatar
TJ Draper
222 posts
7 years ago
TJ Draper's avatar TJ Draper

Thanks for the kick in the right direction. I think I figured out what was going on (and I was mis-understanding/mis-remembering something about how EE modals work).

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

For posterity or another dev coming along with this issue, were you able to confirm?

       
TJ Draper's avatar
TJ Draper
222 posts
7 years ago
TJ Draper's avatar TJ Draper

Yeah so, because it’s been so long since I set that up and worked with the EE CP modals I had the impression that opening the modal and having the href on the modal button would prompt the modal to get the contents from that href. That was incorrect, I was actually doing that with my own code. Apparently I had a problem with binding too early and had a timeout on my methods so things were not binding right away. I added code to make the binding happen right away, and left the timeout in place to confirm that the bind actually happened.

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

Bueno, thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.